Skip to content
Browse files

Fix bug in DohNewStringWithSize(): guarantee string is nul-terminated

  • Loading branch information...
1 parent 22be94d commit 6612997b63f29e5e1888198b7e23eb105aa72844 Karl Wette committed Jun 1, 2014
Showing with 1 addition and 0 deletions.
  1. +1 −0 Source/DOH/string.c
View
1 Source/DOH/string.c
@@ -1114,6 +1114,7 @@ DOHString *DohNewStringWithSize(const DOHString_or_char *so, int len) {
str->maxsize = max;
if (s) {
strncpy(str->str, s, len);
+ str->str[l] = 0;
str->len = l;
str->sp = l;
} else {

0 comments on commit 6612997

Please sign in to comment.
Something went wrong with that request. Please try again.