/me should learn to differ between script-languages and C... strings in C are still...
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 25 Feb 2005 23:30:35 +0000 (23:30 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 25 Feb 2005 23:30:35 +0000 (23:30 +0000)
fixed allocation of the newly generated option string

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1871 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/secure-mount.c

index 854c0c9..37baa3c 100644 (file)
@@ -323,14 +323,14 @@ callExternalMount(struct MountInfo const *mnt)
     if (mnt->mask & MS_NODEV)
       argv[idx++] = mnt->data;
     else {
-      char const       tmp[strlen(mnt->data) + sizeof("nodev,")];
+      char *   tmp = alloca(strlen(mnt->data) + sizeof("nodev,"));
       strcpy(tmp, "nodev,");
       strcat(tmp, mnt->data);
       argv[idx++] = tmp;
     }
   }
   else
-    argv[idx++] = 'nodev';
+    argv[idx++] = "nodev";
 
   if (mnt->type) {
     argv[idx++] = "-t";