mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-24 10:33:35 +08:00
In fsck, check return from malloc of fsck_path, and print an error message
if it fails.
This commit is contained in:
parent
690e693caf
commit
c88bce8df0
@ -1,3 +1,7 @@
|
||||
2004-12-22 Theodore Ts'o <tytso@mit.edu>
|
||||
|
||||
* fsck.c (main): Check return from malloc of fsck_path string.
|
||||
|
||||
2004-12-21 Theodore Ts'o <tytso@mit.edu>
|
||||
|
||||
* tune2fs.c (parse_time): Fix minor buglet; the parse_time routine
|
||||
|
@ -1221,6 +1221,10 @@ int main(int argc, char *argv[])
|
||||
if (oldpath) {
|
||||
fsck_path = malloc (strlen (fsck_prefix_path) + 1 +
|
||||
strlen (oldpath) + 1);
|
||||
if (!fsck_path) {
|
||||
fprintf(stderr, "%s: Unable to allocate memory for fsck_path\n", progname);
|
||||
exit(EXIT_ERROR);
|
||||
}
|
||||
strcpy (fsck_path, fsck_prefix_path);
|
||||
strcat (fsck_path, ":");
|
||||
strcat (fsck_path, oldpath);
|
||||
|
Loading…
Reference in New Issue
Block a user