Skip to content

Commit 4b5677d

Browse files
committed
Bound the number of attempts my_mkstemps tries to compute a file name
Without this bound there are unreachable instructions at the end of the function.
1 parent b8743fa commit 4b5677d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/tempfile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ int my_mkstemps(char *template_str, int suffix_len)
6262
static long long unsigned int random_state;
6363
random_state+=getpid()+123;
6464

65-
for(unsigned attempt=0; ; ++attempt)
65+
for(unsigned attempt = 0; attempt < 1000; ++attempt)
6666
{
6767
unsigned long long number=random_state;
6868

0 commit comments

Comments
 (0)