From 16f53e0717b60660145388b0feb351628f606211 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Wed, 19 Nov 2008 05:59:33 +0000 Subject: 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 --- plugins/check_ntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/check_ntp.c') diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 68c82d11..489ad60a 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c @@ -198,7 +198,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); -- cgit v1.2.3