[haiku-commits] haiku: hrev46332 - in src: system/boot/loader/file_systems/fat add-ons/kernel/drivers/audio/ac97

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 9 Nov 2013 13:57:24 +0100 (CET)

hrev46332 adds 2 changesets to branch 'master'
old head: a0f124211a035461631ac52b9dd0b3e274f1156c
new head: f559e518354b9e523fb077b1778f3fc33759c064
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=f559e51+%5Ea0f1242

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

7f0b39a: CID 991479 Out-of-bounds access

f559e51: CID 991592 Uninitialized scalar variable

                                   [ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

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

2 files changed, 4 insertions(+), 1 deletion(-)
src/add-ons/kernel/drivers/audio/ac97/ac97.c          | 2 ++
src/system/boot/loader/file_systems/fat/Directory.cpp | 3 ++-

############################################################################

Commit:      7f0b39a7916d808b09d5ce4bc1cb1e233c80d37f
URL:         http://cgit.haiku-os.org/haiku/commit/?id=7f0b39a
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sat Nov  9 12:40:07 2013 UTC

CID 991479 Out-of-bounds access

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

diff --git a/src/system/boot/loader/file_systems/fat/Directory.cpp 
b/src/system/boot/loader/file_systems/fat/Directory.cpp
index 1706473..77eaf27 100644
--- a/src/system/boot/loader/file_systems/fat/Directory.cpp
+++ b/src/system/boot/loader/file_systems/fat/Directory.cpp
@@ -482,7 +482,8 @@ Directory::CreateFile(const char* name, mode_t permissions, 
Node** _node)
        // prepare a directory entry for the new file
        dir_entry entry;
 
-       memset(entry.fName, ' ', 11);
+       memset(entry.fName, ' ', sizeof(entry.fName));
+       memset(entry.fExt, ' ', sizeof(entry.fExt));
                // clear both base name and extension
        memcpy(entry.fName, baseName, baseNameLength);
        if (extensionLength > 0)

############################################################################

Revision:    hrev46332
Commit:      f559e518354b9e523fb077b1778f3fc33759c064
URL:         http://cgit.haiku-os.org/haiku/commit/?id=f559e51
Author:      Jérôme Duval <jerome.duval@xxxxxxxxx>
Date:        Sat Nov  9 12:55:57 2013 UTC

CID 991592 Uninitialized scalar variable

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

diff --git a/src/add-ons/kernel/drivers/audio/ac97/ac97.c 
b/src/add-ons/kernel/drivers/audio/ac97/ac97.c
index d0a63d6..edad232 100644
--- a/src/add-ons/kernel/drivers/audio/ac97/ac97.c
+++ b/src/add-ons/kernel/drivers/audio/ac97/ac97.c
@@ -32,6 +32,7 @@
 #include <OS.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <MediaDefs.h>
 #include "ac97.h"
 
@@ -244,6 +245,7 @@ ac97_attach(ac97_dev **_dev, codec_reg_read reg_read, 
codec_reg_write reg_write,
        int i;
 
        *_dev = dev = (ac97_dev *) malloc(sizeof(ac97_dev));
+       memset(dev->reg_cache, 0, sizeof(dev->reg_cache));
        dev->cookie = cookie;
        dev->reg_read = reg_read;
        dev->reg_write = reg_write;


Other related posts:

  • » [haiku-commits] haiku: hrev46332 - in src: system/boot/loader/file_systems/fat add-ons/kernel/drivers/audio/ac97 - korli