summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2009-08-21 16:37:20 +0000
committerDimitri Sokolyuk <demon@dim13.org>2009-08-21 16:37:20 +0000
commiteffaa1fbe4600f8800500545c6092135d549227a (patch)
tree3ef329c9b5f3f3658ab58eef20b377dc2366fc06
parenta0a0b6006ce10522e393c7590a13efe176511d13 (diff)
fix buffer overflow
-rw-r--r--7seg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/7seg.c b/7seg.c
index 941fae8..3eaa40e 100644
--- a/7seg.c
+++ b/7seg.c
@@ -61,7 +61,7 @@ main(int argc, char **argv)
*s[3] = '\0';
for (i = 0; i < 3; i++) {
- p = malloc(len + 1);
+ p = malloc(3 * len + 1);
s[i] = p;
do {
if (*c < '0' || *c > '9')