'tmpbuf' was unused. Limit [name] entry to 255 chars to avoid
overflowing the buffer.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
{
unsigned int global;
struct thread_data *td;
- char *string, *name, *tmpbuf;
+ char *string, *name;
fpos_t off;
FILE *f;
char *p;
string = malloc(4096);
name = malloc(256);
- tmpbuf = malloc(4096);
+ memset(name, 0, 256);
stonewall = stonewall_flag;
while ((p = fgets(string, 4096, f)) != NULL) {
break;
if (is_empty_or_comment(p))
continue;
- if (sscanf(p, "[%s]", name) != 1)
+ if (sscanf(p, "[%255s]", name) != 1)
continue;
global = !strncmp(name, "global", 6);
free(string);
free(name);
- free(tmpbuf);
fclose(f);
return ret;
}