summaryrefslogtreecommitdiff
path: root/src/bin/embryo
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-08-12 18:30:24 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-08-12 18:32:40 +0100
commit3e5bd813d3978558c5e164c7819b18f51e810ec2 (patch)
tree9b6b791c4da60dcdc25ba0dd11538fc8e0168fa6 /src/bin/embryo
parentd84e77d93fc42e5d016dec2dd5b3ba63a91d9c4b (diff)
embryo: Fix a potential buffer overflow (klocwork id 321)
Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Diffstat (limited to 'src/bin/embryo')
-rw-r--r--src/bin/embryo/embryo_cc_sc1.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c
index 4c49a60d24..0340d35cbb 100644
--- a/src/bin/embryo/embryo_cc_sc1.c
+++ b/src/bin/embryo/embryo_cc_sc1.c
@@ -679,10 +679,15 @@ setconfig(char *root)
679 { 679 {
680 strcat(path, "include"); 680 strcat(path, "include");
681 } 681 }
682 len = strlen(path); 682
683 path[len] = DIRSEP_CHAR; 683 /* Make sure we have enough space for the trailing DIRSEP_CHAR */
684 path[len + 1] = '\0'; 684 if (strlen(path) == sizeof(path) - 1)
685 insert_path(path); 685 {
686 len = strlen(path);
687 path[len] = DIRSEP_CHAR;
688 path[len + 1] = '\0';
689 insert_path(path);
690 }
686 } /* if */ 691 } /* if */
687} 692}
688 693