mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-23 07:07:00 -04:00
check_curl: fixed a potential buffer overflow in retir/uri_string
This commit is contained in:
parent
3f5c54c783
commit
de5503063e
1 changed files with 2 additions and 2 deletions
|
|
@ -1033,8 +1033,8 @@ char*
|
|||
uri_string (const UriTextRangeA range, char* buf, size_t buflen)
|
||||
{
|
||||
if (!range.first) return "(null)";
|
||||
strncpy (buf, range.first, max (buflen, range.afterLast - range.first));
|
||||
buf[max (buflen, range.afterLast - range.first)] = '\0';
|
||||
strncpy (buf, range.first, max (buflen-1, range.afterLast - range.first));
|
||||
buf[max (buflen-1, range.afterLast - range.first)] = '\0';
|
||||
buf[range.afterLast - range.first] = '\0';
|
||||
return buf;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue