We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e85248 commit 06a27f9Copy full SHA for 06a27f9
src/runtime.c
@@ -719,11 +719,16 @@ int main(int argc, char *argv[]) {
719
int dir_fd, res;
720
721
size_t templen = strlen(temp_base);
722
+
723
+ // allocate enough memory (size of name won't exceed 60 bytes)
724
char mount_dir[templen + 60];
725
726
size_t namelen = strlen(basename(argv[0]));
- if(namelen>6){
- namelen=6;
727
+ // limit length of tempdir name
728
+ if(namelen > 6){
729
+ namelen = 6;
730
}
731
732
strcpy(mount_dir, temp_base);
733
strncpy(mount_dir+templen, "/.mount_", 8);
734
strncpy(mount_dir+templen+8, basename(argv[0]), namelen);
0 commit comments