]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/fshelp.c (grub_fshelp_find_file): Set currnode to 0
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 22 May 2012 06:24:27 +0000 (08:24 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 22 May 2012 06:24:27 +0000 (08:24 +0200)
after freeing for safety.

ChangeLog
grub-core/fs/fshelp.c

index 92a5f811d9ee1c3ba431e9e4282fd26d4f35cdd7..059b6e405319259773634d1135ca9babf1f6ce05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-22  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/fshelp.c (grub_fshelp_find_file): Set currnode to 0
+       after freeing for safety.
+
 2012-05-21  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/commands/sleep.c (do_print): Add missing grub_refresh.
index 0d4162ea7ac9c71bb845a309a70bb22278b3c6cd..1cb9fcf12a85805b4baaeccede300208b3224148 100644 (file)
@@ -129,6 +129,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
          if (type != GRUB_FSHELP_DIR)
            {
              free_node (currnode);
+             currnode = 0;
              return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
            }
 
@@ -137,6 +138,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
          if (! found)
            {
              free_node (currnode);
+             currnode = 0;
              if (grub_errno)
                return grub_errno;
 
@@ -153,12 +155,14 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
                {
                  free_node (currnode);
                  free_node (oldnode);
+                 currnode = 0;
                  return grub_error (GRUB_ERR_SYMLINK_LOOP,
                                      N_("too deep nesting of symlinks"));
                }
 
              symlink = read_symlink (currnode);
              free_node (currnode);
+             currnode = 0;
 
              if (!symlink)
                {