crypto/bio/b_print.c; useless check "(iplace == sizeof iconvert)"
Closed, ResolvedPublic

Description

This check seems to be useless, or ? :

if (iplace == sizeof iconvert)
    iplace--;
iconvert[iplace] = 0;<--- Array 'iconvert[20]' accessed at index 20, which

is out of bounds. Otherwise condition 'iplace==20' is redundant.

/* convert fractional part */
do {
    fconvert[fplace++] =
        (caps ? "0123456789ABCDEF"
          : "0123456789abcdef")[fracpart % 10];
    fracpart = (fracpart / 10);
} while (fplace < max);
if (fplace == sizeof fconvert)
    fplace--;
fconvert[fplace] = 0;<--- Array 'fconvert[20]' accessed at index 20, which

is out of bounds. Otherwise condition 'fplace==20' is redundant.

toralf added a subscriber: toralf.
werner added a subscriber: werner.Jul 3 2014, 11:26 AM

This does not look like any GnuPG related code. Did you want to report this to
OpenSSL?

toralf closed this task as Resolved.Jul 3 2014, 4:57 PM
toralf claimed this task.

yes - I
I'll repoet this to OpenSSL - pls close this as PEBKAC.
sry.