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) { strcat(path, "include"); } - len = strlen(path); - path[len] = DIRSEP_CHAR; - path[len + 1] = '\0'; - insert_path(path); + + /* Make sure we have enough space for the trailing DIRSEP_CHAR */ + if (strlen(path) == sizeof(path) - 1) + { + len = strlen(path); + path[len] = DIRSEP_CHAR; + path[len + 1] = '\0'; + insert_path(path); + } } /* if */ }