]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stdio: Fix a possible buffer overflow
authorBradley Bolen <bradleybolen@yahoo.com>
Mon, 22 Aug 2011 11:48:05 +0000 (11:48 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 4 Sep 2011 21:27:52 +0000 (23:27 +0200)
Signed-off-by: Bradley Bolen <bradleybolen at yahoo.com>
common/stdio.c

index b20772c45d7f05d550a358fcbf1755c501e6e5b9..1bf9ba082978c074d2b5b6baf21827e1484a6449 100644 (file)
@@ -160,7 +160,7 @@ int stdio_deregister(const char *devname)
        int l;
        struct list_head *pos;
        struct stdio_dev *dev;
-       char temp_names[3][8];
+       char temp_names[3][16];
 
        dev = stdio_get_by_name(devname);
 
@@ -174,7 +174,7 @@ int stdio_deregister(const char *devname)
                }
                memcpy (&temp_names[l][0],
                        stdio_devices[l]->name,
-                       sizeof(stdio_devices[l]->name));
+                       sizeof(temp_names[l]));
        }
 
        list_del(&(dev->list));