aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_ntp_peer.c
diff options
context:
space:
mode:
authorGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2008-11-19 05:59:33 +0000
committerGravatar Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> 2008-11-19 05:59:33 +0000
commit16f53e0717b60660145388b0feb351628f606211 (patch)
tree9b1ce2730cfb9b8c255da8c3c137cc1e98e22d39 /plugins/check_ntp_peer.c
parent53058522125ef86a65c241ad0a5f56df01d55d6a (diff)
downloadmonitoring-plugins-16f53e0717b60660145388b0feb351628f606211.tar.gz
Fixed buffer overflow in check_ntp/check_ntp_peer (#1999319, Ubuntu #291265)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2086 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_ntp_peer.c')
-rw-r--r--plugins/check_ntp_peer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c
index 3add2737..e489a580 100644
--- a/plugins/check_ntp_peer.c
+++ b/plugins/check_ntp_peer.c
@@ -131,7 +131,7 @@ typedef struct {
/* NTP control message header is 12 bytes, plus any data in the data
* field, plus null padding to the nearest 32-bit boundary per rfc.
*/
-#define SIZEOF_NTPCM(m) (12+ntohs(m.count)+((m.count)?4-(ntohs(m.count)%4):0))
+#define SIZEOF_NTPCM(m) (12+ntohs(m.count)+((ntohs(m.count)%4)?4-(ntohs(m.count)%4):0))
/* finally, a little helper or two for debugging: */
#define DBG(x) do{if(verbose>1){ x; }}while(0);