[haiku-commits] haiku: hrev45859 - src/add-ons/kernel/file_systems/btrfs

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 15 Jul 2013 17:41:03 +0200 (CEST)

hrev45859 adds 1 changeset to branch 'master'
old head: 517050adb5b4c5ed7caccc7c599668c060c525c7
new head: ddc2a758e6a5f4b5e15990153dbe8e663732e797
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=ddc2a75+%5E517050a

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

ddc2a75: Chunk::Chunk(), Fix Null pointer argument in call to memory copy 
function
  
  Signed-off-by: Jérôme Duval <jerome.duval@xxxxxxxxx>

                                      [ Murai Takashi <tmurai01@xxxxxxxxx> ]

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

Revision:    hrev45859
Commit:      ddc2a758e6a5f4b5e15990153dbe8e663732e797
URL:         http://cgit.haiku-os.org/haiku/commit/?id=ddc2a75
Author:      Murai Takashi <tmurai01@xxxxxxxxx>
Date:        Sun Jul 14 08:34:46 2013 UTC
Committer:   Jérôme Duval <jerome.duval@xxxxxxxxx>
Commit-Date: Mon Jul 15 15:25:13 2013 UTC

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

1 file changed, 4 insertions(+), 1 deletion(-)
src/add-ons/kernel/file_systems/btrfs/Chunk.cpp | 5 ++++-

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

diff --git a/src/add-ons/kernel/file_systems/btrfs/Chunk.cpp 
b/src/add-ons/kernel/file_systems/btrfs/Chunk.cpp
index 95d82a4..ee08cbd 100644
--- a/src/add-ons/kernel/file_systems/btrfs/Chunk.cpp
+++ b/src/add-ons/kernel/file_systems/btrfs/Chunk.cpp
@@ -30,8 +30,11 @@ Chunk::Chunk(struct btrfs_chunk* chunk, fsblock_t offset)
        fChunkOffset = offset;
        fChunk = (struct btrfs_chunk*)malloc(sizeof(struct btrfs_chunk)
                + chunk->StripeCount() * sizeof(struct btrfs_stripe));
-       if (fChunk == NULL)
+       if (fChunk == NULL) {
                fInitStatus = B_NO_MEMORY;
+               return;
+       }
+
        memcpy(fChunk, chunk, sizeof(struct btrfs_chunk)
                + chunk->StripeCount() * sizeof(struct btrfs_stripe));
 


Other related posts:

  • » [haiku-commits] haiku: hrev45859 - src/add-ons/kernel/file_systems/btrfs - korli