|
@@ -2875,6 +2875,7 @@ int machines__create_guest_kernel_maps(struct rb_root *machines)
|
|
|
int i, items = 0;
|
|
|
char path[PATH_MAX];
|
|
|
pid_t pid;
|
|
|
+ char *endp;
|
|
|
|
|
|
if (symbol_conf.default_guest_vmlinux_name ||
|
|
|
symbol_conf.default_guest_modules ||
|
|
@@ -2891,7 +2892,14 @@ int machines__create_guest_kernel_maps(struct rb_root *machines)
|
|
|
/* Filter out . and .. */
|
|
|
continue;
|
|
|
}
|
|
|
- pid = atoi(namelist[i]->d_name);
|
|
|
+ pid = (pid_t)strtol(namelist[i]->d_name, &endp, 10);
|
|
|
+ if ((*endp != '\0') ||
|
|
|
+ (endp == namelist[i]->d_name) ||
|
|
|
+ (errno == ERANGE)) {
|
|
|
+ pr_debug("invalid directory (%s). Skipping.\n",
|
|
|
+ namelist[i]->d_name);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
sprintf(path, "%s/%s/proc/kallsyms",
|
|
|
symbol_conf.guestmount,
|
|
|
namelist[i]->d_name);
|