Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ serverinfo {
ssld_count = 1;

/* tls_min_ver: minimum version of ssl/tls we support. Options are as follows
* "ssl3", "tls1.0", "tls1.1" and "tls1.2". SSLv3 is broken and shouldn't be used.
* "ssl3", "tls1.0", "tls1.1", "tls1.2" and "tls1.3". SSLv3 is broken and shouldn't be used.
* Also some versions of OpenSSL may have SSLv3 disabled entirely, in such case
* tls1 will be enforced regardless of this parameter.
*/
Expand Down
2 changes: 1 addition & 1 deletion libratbox/include/rb_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ rb_strlcat(char *dest, const char *src, size_t count)
size_t len = strlen(src);
size_t res = dsize + len;

assert(dsize >= count);
assert(dsize < count);

dest += dsize;
count -= dsize;
Expand Down
3 changes: 2 additions & 1 deletion libratbox/src/linebuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ rb_linebuf_get(rb_buf_head_t * bufhead, char *buf, size_t buflen, bool partial,
size_t cpylen;
char *start, *ch;

lrb_assert(buflen > 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid abort when recvq is empty for zlib setup

The new lrb_assert(buflen > 0) in rb_linebuf_get will abort in builds without SOFT_ASSERT when buflen is 0. This is reachable in start_zlib_session (src/sslproc.c) because it calls rb_linebuf_get in a do { ... } while (cpylen > 0) loop with left = recvqlen, and recvqlen can be 0 when no data is queued. In that case the first call passes buflen==0 and the process asserts, which is a regression from the previous behavior where empty queues were tolerated. Consider early-returning on buflen==0 or skipping the call when recvqlen==0.

Useful? React with 👍 / 👎.


/* make sure we have a line */
if(bufhead->list.head == NULL)
return 0; /* Obviously not.. hrm. */
Expand Down Expand Up @@ -897,4 +899,3 @@ unsigned int rb_linebuf_numlines(rb_buf_head_t *bufhead)
{
return bufhead->numlines;
}

3 changes: 1 addition & 2 deletions src/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ parse_nameservers(char **parv, int parc)
rb_dlinkDestroy(ptr, &nameservers);
}

for(i = 2; i < parc; i++)
for(i = 1; i < parc; i++)
{
server = rb_strdup(parv[i]);
rb_dlinkAddTailAlloc(server, &nameservers);
Expand Down Expand Up @@ -408,4 +408,3 @@ rehash_resolver(void)
{
rb_helper_write(dns_helper, "R");
}