Fix security issue with PB_ENABLE_MALLOC.
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sat, 17 May 2014 17:06:55 +0000 (20:06 +0300)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sat, 17 May 2014 17:06:55 +0000 (20:06 +0300)
commit5ef128616baffd15bb904fc56f651d40901be429
treed09614ab604b9398de88c09870b6ac8b26af5c5f
parentba2ab9ea65d029b2560c461be317f3cf0d19eb3e
Fix security issue with PB_ENABLE_MALLOC.

The multiplication in allocate_field could potentially overflow,
leading to allocating too little memory. This could subsequently
allow an attacker to cause a write past the buffer, overwriting
other memory contents.

The attack is possible if untrusted message data is decoded using
nanopb, and the message type includes a pointer-type string or bytes
field, or a repeated numeric field. Submessage fields are not
affected.

This issue only affects systems that have been compiled with
PB_ENABLE_MALLOC enabled. Only version nanopb-0.2.7 is affected,
as prior versions do not include this functionality.

Update issue 117
Status: FixedInGit
pb_decode.c