updates
[crypto.git] / lib / silccore / silcid.c
index 6e892c087b2a8dedb675bbf4206408873fe48637..57524d36af8addbbab813db00bb24c59cea79143 100644 (file)
@@ -67,7 +67,7 @@ SilcIDPayload silc_id_payload_parse(const unsigned char *payload,
 
   silc_buffer_pull(&buffer, 4);
 
-  if (newp->len > buffer.len || newp->len > SILC_PACKET_MAX_ID_LEN)
+  if (newp->len > buffer.len - 4 || newp->len > SILC_PACKET_MAX_ID_LEN)
     goto err;
 
   ret = silc_buffer_unformat(&buffer,