gpg: Fix possible read of unallocated memory
authorWerner Koch <wk@gnupg.org>
Fri, 12 Dec 2014 09:41:25 +0000 (10:41 +0100)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 13 Jan 2015 01:44:11 +0000 (10:44 +0900)
commitd2b0e613131d52da54c3dbd72f4bfba8f7b71ad3
tree4be5bceb5d21eac173f625435031deea9e5447b3
parentd92fe965f3290a200d0a578decdd0867817b3b7b
gpg: Fix possible read of unallocated memory

* g10/parse-packet.c (can_handle_critical): Check content length
before calling can_handle_critical_notation.
--

The problem was found by Jan Bee and gniibe proposed the used fix.
Thanks.

This bug can't be exploited: Only if the announced length of the
notation is 21 or 32 a memcmp against fixed strings using that length
would be done.  The compared data is followed by the actual signature
and thus it is highly likely that not even read of unallocated memory
will happen.  Nevertheless such a bug needs to be fixed.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/parse-packet.c