Home GnuPG

Detect a possible overflow directly in the TLV parser.

Description

Detect a possible overflow directly in the TLV parser.

* src/ber-help.c (_ksba_ber_read_tl): Check for overflow of a commonly
used sum.

It is quite common to have checks like

if (ti.nhdr + ti.length >= DIM(tmpbuf))
   return gpg_error (GPG_ERR_TOO_LARGE);

This patch detects possible integer overflows immmediately when
creating the TI object.

  • Reported-by: ZDI-CAN-18927, ZDI-CAN-18928, ZDI-CAN-18929

Details

Provenance
wernerAuthored on Oct 5 2022, 2:19 PM
Parents
rKe11e17620189: Post release updates
Branches
Unknown
Tags
Unknown