Home GnuPG
Diffusion GnuPG 35db798c2df7

common: Make openpgp_oid_to_str more robust.
35db798c2df7Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

common: Make openpgp_oid_to_str more robust.

* common/openpgp-oid.c (openpgp_oid_to_str): Take care of
gcry_mpi_get_opaque returning NULL.  Remove useless condition !BUF.

It is possible that an opaque MPI stores just a NULL pointer. Take
care of that before incrementing the pointer. We return an error in
this case because at least a length byte is required.

Found due to hint from stack 0.3:

bug: anti-simplify
model: |
  %tobool15 = icmp ne i8* %incdec.ptr, null, !dbg !567
  -->  true
stack:
  - /home/wk/s/gnupg/common/openpgp-oid.c:220:0
ncore: 1
core:
  - /home/wk/s/gnupg/common/openpgp-oid.c:212:0
    - pointer overflow
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Mar 15 2015, 12:07 PM
Parents
rGefde50f92af2: agent: Improve error reporting from Pinentry.
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rG35db798c2df7: common: Make openpgp_oid_to_str more robust. (authored by Werner Koch <wk@gnupg.org>).Mar 15 2015, 12:07 PM