Browse Source

[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
personal/stbuehler/mod-csrf-old
Glenn Strauss 5 years ago
parent
commit
ebf3af8b12
  1. 2
      src/buffer.c

2
src/buffer.c

@ -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 ~ */

Loading…
Cancel
Save