Guard memset in camessage.c to prevent wild memory overrun if mismatch

between payload and data size.
This commit is contained in:
Michael Abbott
2010-08-11 16:49:46 -05:00
committed by Andrew Johnson
parent 9d9ba1a442
commit e54b631b8d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -41,7 +41,7 @@
# include "shareLib.h"
#endif
#define CA_MINOR_PROTOCOL_REVISION 12
#define CA_MINOR_PROTOCOL_REVISION 13
#include "caProto.h"
#include "cacIO.h"
+1 -1
View File
@@ -605,7 +605,7 @@ static void read_reply ( void *pArg, struct dbAddr *paddr,
payload_size = data_size;
cas_set_header_count(pClient, item_count);
}
else
else if (payload_size > data_size)
memset(
(char *) pPayload + data_size, 0, payload_size - data_size);
}