ensure path length fits in buffer in batget

SVN revision: 80844
This commit is contained in:
Mike Blumenkrantz 2012-12-13 13:18:07 +00:00
parent 41236712d9
commit 0774c6bf65
1 changed files with 1 additions and 0 deletions

View File

@ -996,6 +996,7 @@ linux_acpi_init(void)
char buf[PATH_MAX];
FILE *f;
if (info->name_length + sizeof("/state") >= sizeof(buf)) continue;
strcpy(buf, info->path);
strcat(buf, "/state");
f = fopen(buf, "r");