Fixed potential buffer overflow

This commit is contained in:
Pierre Pronchery 2012-09-14 21:31:25 +00:00
parent 29725f24fc
commit 25c84fbf7b

View File

@ -1214,7 +1214,7 @@ static int _target_plugin(Configure * configure, FILE * fp,
fputc('\n', fp); fputc('\n', fp);
fprintf(fp, "%s%s%s%s%s%s%s%s", "\t$(CCSHARED) -o ", target, soext, fprintf(fp, "%s%s%s%s%s%s%s%s", "\t$(CCSHARED) -o ", target, soext,
" $(", target, "_OBJS) $(", target, "_LDFLAGS)"); " $(", target, "_OBJS) $(", target, "_LDFLAGS)");
if((q = malloc(strlen(target) + 4)) != NULL) if((q = malloc(strlen(target) + strlen(soext) + 1)) != NULL)
{ {
sprintf(q, "%s%s", target, soext); sprintf(q, "%s%s", target, soext);
if((p = config_get(configure->config, q, "ldflags")) != NULL) if((p = config_get(configure->config, q, "ldflags")) != NULL)