Browse Source

Preventing NULL dereference if root directory bears a RRIP RE entry

release-1.5.4.branch
Thomas Schmitt 4 years ago
parent
commit
860a91dd2f
  1. 10
      libisofs/fs_image.c
  2. 3
      libisofs/libisofs.h
  3. 2
      libisofs/messages.c

10
libisofs/fs_image.c

@ -1699,6 +1699,12 @@ if (name != NULL && !namecont) {
*/
susp_iter_free(iter);
free(name);
if (flag & 1) {
ret = iso_rr_msg_submit(fsdata, 3, ISO_NO_ROOT_DIR, 0,
"Root directory is marked by RRIP RE as relocated");
ret= ISO_NO_ROOT_DIR;
goto ex;
}
{ret = 0; goto ex;} /* it's not an error */
} else if (SUSP_SIG(sue, 'C', 'L')) {
/*
@ -5734,6 +5740,10 @@ int iso_image_import(IsoImage *image, IsoDataSource *src,
iso_filesystem_unref(fs);
return ret;
}
if (newroot == NULL) {
iso_filesystem_unref(fs);
return ISO_NO_ROOT_DIR;
}
/* Lookup character set even if no AAIP loading is enabled */
ret = iso_file_source_get_aa_string(newroot, &aa_string, 2);

3
libisofs/libisofs.h

@ -8880,6 +8880,9 @@ int iso_conv_name_chars(IsoWriteOpts *opts, char *name, size_t name_len,
(FAILURE, HIGH, -417) */
#define ISO_BAD_GPT_GUID_MODE 0xE830FE5F
/** Unable to obtain root directory (FATAL,HIGH, -418) */
#define ISO_NO_ROOT_DIR 0xF030FE5E
/* Internal developer note:
Place new error codes directly above this comment.

2
libisofs/messages.c

@ -547,6 +547,8 @@ const char *iso_error_to_msg(int errcode)
return "Cannot derive GPT GUID from undefined pseudo-UUID volume timestamp";
case ISO_BAD_GPT_GUID_MODE:
return "Unrecognized GPT disk GUID setup mode";
case ISO_NO_ROOT_DIR:
return "Unable to obtain root directory";
default:
return "Unknown error";
}

Loading…
Cancel
Save