[haiku-commits] haiku: hrev48512 - src/add-ons/kernel/file_systems/userlandfs/server/haiku

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 17 Dec 2014 15:29:49 +0100 (CET)

hrev48512 adds 1 changeset to branch 'master'
old head: c4793b242c5c4c7bcebc4a2702ff139365f017ef
new head: a28398b3a2bff16457174932ab1d7f4e96542880
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=a28398b+%5Ec4793b2

----------------------------------------------------------------------------

a28398b: userlandfs: NULL pointer dereference
  
  get_vnode could be called with a NULL privateNode in the kernel, but not
  in userlandfs. This would crash in cdda mount code (and from a grep
  search, also with several other filesystems).
  
  Now cdda can be mounted with userlandfs, and CDs read that way, but for
  some reason there is no CDDB renaming of the tracks in that case.

                                 [ Adrien Destugues <pulkomandy@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev48512
Commit:      a28398b3a2bff16457174932ab1d7f4e96542880
URL:         http://cgit.haiku-os.org/haiku/commit/?id=a28398b
Author:      Adrien Destugues <pulkomandy@xxxxxxxxx>
Date:        Wed Dec 17 14:25:29 2014 UTC

----------------------------------------------------------------------------

1 file changed, 2 insertions(+), 1 deletion(-)
.../file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp      | 3 ++-

----------------------------------------------------------------------------

diff --git 
a/src/add-ons/kernel/file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp 
b/src/add-ons/kernel/file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp
index d9b1a14..eff9541 100644
--- 
a/src/add-ons/kernel/file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp
+++ 
b/src/add-ons/kernel/file_systems/userlandfs/server/haiku/haiku_kernel_emu.cpp
@@ -204,7 +204,8 @@ get_vnode(fs_volume *_volume, ino_t vnodeID, void 
**privateNode)
        if (error != B_OK)
                return error;
 
-       *privateNode = ((HaikuKernelNode*)foundNode)->private_node;
+       if (privateNode)
+               *privateNode = ((HaikuKernelNode*)foundNode)->private_node;
 
        return B_OK;
 }


Other related posts: