summaryrefslogtreecommitdiffstats
path: root/src/property_list_service.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/property_list_service.c')
-rw-r--r--src/property_list_service.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/property_list_service.c b/src/property_list_service.c
index 80b5f52..5c6d2bd 100644
--- a/src/property_list_service.c
+++ b/src/property_list_service.c
@@ -226,10 +226,10 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
debug_info("initial read failed!");
return PROPERTY_LIST_SERVICE_E_MUX_ERROR;
} else {
- if ((char)pktlen == 0) { /* prevent huge buffers */
+ pktlen = GUINT32_FROM_BE(pktlen);
+ if (pktlen < (1 << 24)) { /* prevent huge buffers */
uint32_t curlen = 0;
char *content = NULL;
- pktlen = GUINT32_FROM_BE(pktlen);
debug_info("%d bytes following", pktlen);
content = (char*)malloc(pktlen);