]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays.
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 29 Nov 2013 04:52:20 +0000 (05:52 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Fri, 29 Nov 2013 04:52:20 +0000 (05:52 +0100)
ChangeLog
grub-core/kern/emu/hostfs.c

index 472e74b5963aaebc5eab6740c83dc1ecf83a19d4..3af11fffb100bc7326d665309ef4e3d1be725272 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-29  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays.
+
 2013-11-29  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub-fstest.c: Remove variable length arrays.
index b5146264123cd67c6fab145d7ba31aa782ccdf54..7e725f65f6a73c67cb6d0a3cf3509e374a29cab5 100644 (file)
@@ -39,8 +39,9 @@ is_dir (const char *path, const char *name)
 {
   int len1 = strlen(path);
   int len2 = strlen(name);
+  int ret;
 
-  char pathname[len1 + 1 + len2 + 1 + 13];
+  char *pathname = xmalloc (len1 + 1 + len2 + 1 + 13);
   strcpy (pathname, path);
 
   /* Avoid UNC-path "//name" on Cygwin.  */
@@ -49,7 +50,9 @@ is_dir (const char *path, const char *name)
 
   strcat (pathname, name);
 
-  return grub_util_is_directory (pathname);
+  ret = grub_util_is_directory (pathname);
+  free (pathname);
+  return ret;
 }
 
 struct grub_hostfs_data