diff --git a/utility.c b/utility.c index 3422d997a..28e333e6f 100644 --- a/utility.c +++ b/utility.c @@ -1636,7 +1636,7 @@ extern int find_real_root_device_name(char* name) if (strcmp(entry->d_name, "..") == 0) continue; - sprintf( fileName, "/dev/%s", entry->d_name); + snprintf( fileName, strlen(name)+1, "/dev/%s", entry->d_name); if (stat(fileName, &statBuf) != 0) continue;