embryo_cc: Fix possible buffer overflow in setconfig()

Need to account for the space of the trailing '/' as well.

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
This commit is contained in:
Daniel Willmann 2013-03-18 12:21:45 +00:00
parent 42d320c523
commit 262f05782b
1 changed files with 2 additions and 1 deletions

View File

@ -683,7 +683,8 @@ setconfig(char *root)
* to the list in that case
*/
*(ptr + 1) = '\0';
if (strlen(path) < (sizeof(path) - 1 - 7))
/* Need room for 'include' and DIRSEP_CHAR - so 8 chars - and \0 */
if (strlen(path) < (sizeof(path) - 1 - 8))
{
strcat(path, "include");
}