[core] fix buffer_copy_string_hex() assert (fixes #2742)

fix buffer_copy_string_hex() passing incorrect length to li_tohex()

(thx Isibaar)

x-ref:
  "Assert wrongly triggered in buffer_copy_string_hex()"
  https://redmine.lighttpd.net/issues/2742
This commit is contained in:
Glenn Strauss 2016-07-30 02:48:20 -04:00
parent acd5e450b5
commit ebf3af8b12
1 changed files with 1 additions and 1 deletions

View File

@ -486,7 +486,7 @@ void buffer_copy_string_hex(buffer *b, const char *in, size_t in_len) {
force_assert(in_len * 2 > in_len);
buffer_string_set_length(b, 2 * in_len);
li_tohex(b->ptr, buffer_string_space(b)+1, in, in_len);
li_tohex(b->ptr, buffer_string_length(b)+1, in, in_len);
}
/* everything except: ! ( ) * - . 0-9 A-Z _ a-z ~ */