vsnprintf() can return a value larger than the buffer size.
Submitted by: assar Obtained from: OpenBSD
This commit is contained in:
parent
e725a1299a
commit
1ee47d0673
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79992
@ -1631,7 +1631,7 @@ output_data(const char *format, ...)
|
||||
remaining = BUFSIZ - (nfrontp - netobuf);
|
||||
}
|
||||
ret = vsnprintf(nfrontp, remaining, format, args);
|
||||
nfrontp += ret;
|
||||
nfrontp += ((ret < remaining - 1) ? ret : remaining - 1);
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1631,7 +1631,7 @@ output_data(const char *format, ...)
|
||||
remaining = BUFSIZ - (nfrontp - netobuf);
|
||||
}
|
||||
ret = vsnprintf(nfrontp, remaining, format, args);
|
||||
nfrontp += ret;
|
||||
nfrontp += ((ret < remaining - 1) ? ret : remaining - 1);
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user