Skip to content
Snippets Groups Projects
Commit 2f8c210a authored by deuce's avatar deuce
Browse files

Do not realloc() shorter than the current string+offset (lops off terminator)

parent 7131220b
Branches
Tags
No related merge requests found
......@@ -1122,7 +1122,7 @@ char *xp_asprintf_next(char *format, int type, ...)
}
this_format_len=strlen(this_format);
if(j>=0) {
if(j>=0 && format_len < (format_len-this_format_len+j)) {
/*
* This isn't necessary if it's already the right size,
* or it's too large... this realloc() should only need to grow
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment