From: Daiki Ueno Date: Thu, 16 Feb 2017 10:35:18 +0000 (+0100) Subject: compat: Fix character generation in mk{s,d}temp() X-Git-Tag: 0.23.4~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=873d391fa5015e8c5c82457a0641ed5bb1e2b7e3;p=p11-kit compat: Fix character generation in mk{s,d}temp() --- diff --git a/common/compat.c b/common/compat.c index 1255b0e..970e5ed 100644 --- a/common/compat.c +++ b/common/compat.c @@ -672,7 +672,7 @@ _gettemp (char *path, /* Fill space with random characters */ while (trv >= path && *trv == 'X') { - rnd = rand () % sizeof (padchar) - 1; + rnd = rand () % (sizeof (padchar) - 1); *trv-- = padchar[rnd]; } start = trv + 1;