Page MenuHome GnuPG

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.

Event Timeline

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

toralf claimed this task.

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