diff options
author | Florian Lohoff <f@zz.de> | 2021-02-15 14:34:07 (GMT) |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2021-02-15 14:34:07 (GMT) |
commit | dae075e65a38c65352d04f8c8fdfa21e2056d01c (patch) | |
tree | a9606e752ff105f10653d4ac48b279c0fd800fef /lib/utils_disk.h | |
parent | 05d7f70d4553e19ea5eb27ec5c97098f014550df (diff) | |
download | monitoring-plugins-dae075e65a38c65352d04f8c8fdfa21e2056d01c.tar.gz |
Using snprintf which honors the buffers size and guarantees null termination. (Closes: #1601)refs/pull/1663/head
As strcpy may overflow the resulting buffer:
flo@p5:~$ /tmp/f/usr/lib/nagios/plugins/check_pgsql -d "$(seq 1 10000)"
*** buffer overflow detected ***: terminated
Aborted
I would propose to change the code rather like this, using snprintf
which honors the buffers size and guarantees null termination.
Diffstat (limited to 'lib/utils_disk.h')
0 files changed, 0 insertions, 0 deletions