incorrect error check
Brought to you by:
chris2511
in copy.c, line 87, the error check is wrong. You should be checking for fp == NULL. I had a file in the directory owned and readable only by root. It could not be opened and instead of warning or exiting, e2fsimage gave a segfault when it sent NULL into the thrid arg of fread().
My change to solve my immediate problem was:
/* open the source file */
fp = fopen(e2c->curr_path, "r");
if (fp == NULL) {
perror(e2c->curr_path);
exit(1);
}
/* unlikely, cause we stated it just some msec before... */
ERRNO_ERR(ret, "Error opening: ", e2c->curr_path);
Thanks for a good tool otherwise!