*/
if ((len > 2) && (str[0] == '<') && (str[len-1] == '>')) {
ino = strtoul(str+1, &end, 0);
- if (*end=='>')
+ if (*end=='>' && (ino <= current_fs->super->s_inodes_count))
return ino;
}
com_err(str, retval, 0);
return 0;
}
+ if (ino > current_fs->super->s_inodes_count) {
+ com_err(str, 0, "resolves to an illegal inode number: %u\n",
+ ino);
+ return 0;
+ }
return ino;
}
const char *tz;
if (do_gmt == -1) {
- /* The diet libc doesn't respect the TZ environemnt variable */
+ /* The diet libc doesn't respect the TZ environment variable */
tz = ss_safe_getenv("TZ");
if (!tz)
tz = "";