]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
VG_(mkstemp): fix infinite loop in the case where /tmp isn't
authorJulian Seward <jseward@acm.org>
Mon, 9 May 2011 22:42:06 +0000 (22:42 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 9 May 2011 22:42:06 +0000 (22:42 +0000)
writable.  Fixes #223249.  (Florian Krohm, britzel@acm.org)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11737

coregrind/m_libcfile.c

index 2b9e44547c1c3c3542292f453f0a7a6fa633fd1f..05ae152aad0197faf033ed4ba47bcc60b13d855a 100644 (file)
@@ -641,7 +641,7 @@ Int VG_(mkstemp) ( HChar* part_of_name, /*OUT*/HChar* fullname )
 
    tries = 0;
    while (True) {
-      if (tries > 10) 
+      if (tries++ > 10) 
          return -1;
       VG_(sprintf)( buf, "/tmp/valgrind_%s_%08x", 
                          part_of_name, VG_(random)( &seed ));