diff options
author | Vadim Zhukov <persgray@gmail.com> | 2017-07-19 13:55:08 +0300 |
---|---|---|
committer | Sven Nierlein <sven@nierlein.org> | 2020-01-21 20:40:30 +0100 |
commit | 60ec4d29019c553451d828fe366c8acc46fc8162 (patch) | |
tree | 819075e88ebc27364e05ca65ad3a70542bdea7cc | |
parent | f53ea7afd8e124690871ebdb79a1432e4dd14488 (diff) | |
download | monitoring-plugins-60ec4d29019c553451d828fe366c8acc46fc8162.tar.gz |
Use size_t instead of int when calling sysctl(3).
Otherwise, it writes sizeof(size_t) bytes to &oldlen, smashing the stack.
-rw-r--r-- | plugins-root/check_dhcp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index f4c2dafd..ad673237 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c | |||
@@ -323,7 +323,8 @@ int get_hardware_address(int sock,char *interface_name){ | |||
323 | #elif defined(__bsd__) | 323 | #elif defined(__bsd__) |
324 | /* King 2004 see ACKNOWLEDGEMENTS */ | 324 | /* King 2004 see ACKNOWLEDGEMENTS */ |
325 | 325 | ||
326 | int mib[6], len; | 326 | size_t len; |
327 | int mib[6]; | ||
327 | char *buf; | 328 | char *buf; |
328 | unsigned char *ptr; | 329 | unsigned char *ptr; |
329 | struct if_msghdr *ifm; | 330 | struct if_msghdr *ifm; |