Correct WHOX overflow check so it also works for fields other than the last.
Found with llvm static analyzer.
This commit is contained in:
parent
f93bc39774
commit
94734aacc6
1 changed files with 1 additions and 1 deletions
|
@ -442,7 +442,7 @@ append_format(char *buf, size_t bufsize, size_t *pos, const char *fmt, ...)
|
||||||
|
|
||||||
max = *pos >= bufsize ? 0 : bufsize - *pos;
|
max = *pos >= bufsize ? 0 : bufsize - *pos;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
result = rb_vsnprintf(buf + *pos, bufsize - *pos, fmt, ap);
|
result = rb_vsnprintf(buf + *pos, max, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
*pos += result;
|
*pos += result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue