Fix bad use of "sizeof(pointer)" where the length of a buffer was the
intention. Fixes problems with least ssh's known_hosts file and factor. Patch from Berndt Josef Wulf's PR lib/22347.
This commit is contained in:
parent
0f5220a9e0
commit
658a8c458e
|
@ -139,12 +139,12 @@ char *BN_bn2dec(const BIGNUM *a)
|
|||
/* We now have a series of blocks, BN_DEC_NUM chars
|
||||
* in length, where the last one needs truncation.
|
||||
* The blocks need to be reversed in order. */
|
||||
snprintf(p, sizeof(buf) - (p - buf), BN_DEC_FMT1, *lp);
|
||||
snprintf(p, num - (p - buf) + 3, BN_DEC_FMT1, *lp);
|
||||
while (*p) p++;
|
||||
while (lp != bn_data)
|
||||
{
|
||||
lp--;
|
||||
snprintf(p, sizeof(buf) - (p - buf), BN_DEC_FMT2, *lp);
|
||||
snprintf(p, num - (p - buf) + 3, BN_DEC_FMT2, *lp);
|
||||
while (*p) p++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue