mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
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;
|
||||
va_start(ap, fmt);
|
||||
result = rb_vsnprintf(buf + *pos, bufsize - *pos, fmt, ap);
|
||||
result = rb_vsnprintf(buf + *pos, max, fmt, ap);
|
||||
va_end(ap);
|
||||
*pos += result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue