]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/stdio.c
stdio: Fix a possible buffer overflow
[karo-tx-uboot.git] / 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));