Fix mkstemps() extension handling. Sudoedit will now preserve the
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 18 Feb 2015 13:24:31 +0000 (06:24 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 18 Feb 2015 13:24:31 +0000 (06:24 -0700)
extension properly when the system libc lacks mkstemps().

lib/util/mktemp.c

index 50ce6ccda4fa045bbd620f468b543d4279fa6aa3..fa86d123e8d636c34f78af99c9fdbabc4e5306d9 100644 (file)
@@ -140,7 +140,7 @@ mktemp_internal(char *path, int slen, int mode)
        tries *= 2;
 
        do {
-               for (cp = start; *cp; cp++) {
+               for (cp = start; cp != ep; cp++) {
                        r = get_random() % NUM_CHARS;
                        *cp = tempchars[r];
                }