Avoid wandering over the beginning of the actual buffer

if the passed template string contains only 'X' characters.

Submitted by:	Mark Andrews <marka@isc.org> (patch modified)
PR:		38402
This commit is contained in:
robert 2002-05-23 14:21:02 +00:00
parent 2354de18fe
commit 6131a2e28e

@ -128,7 +128,7 @@ _gettemp(path, doopen, domkdir, slen)
}
/* Fill space with random characters */
while (*trv == 'X') {
while (trv >= path && *trv == 'X') {
rand = arc4random() % (sizeof(padchar) - 1);
*trv-- = padchar[rand];
}