We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0eca423 commit 45a3b9cCopy full SHA for 45a3b9c
tests/clar/sandbox.h
@@ -1,3 +1,7 @@
1
+#ifdef __APPLE__
2
+#include <sys/syslimits.h>
3
+#endif
4
+
5
static char _clar_path[4096];
6
7
static int
@@ -31,13 +35,21 @@ find_tmp_path(char *buffer, size_t length)
31
35
continue;
32
36
33
37
if (is_valid_tmp_path(env)) {
38
39
+ if (length >= PATH_MAX && realpath(env, buffer) != NULL)
40
+ return 0;
41
34
42
strncpy(buffer, env, length);
43
return 0;
44
}
45
46
47
/* If the environment doesn't say anything, try to use /tmp */
48
if (is_valid_tmp_path("/tmp")) {
49
50
+ if (length >= PATH_MAX && realpath("/tmp", buffer) != NULL)
51
52
53
strncpy(buffer, "/tmp", length);
54
55
0 commit comments