Browse Source

Avoiding NULL pointer dereference in case of unexpected file type.

Coverity CID 12550.
release-1.5.4.branch
Thomas Schmitt 6 years ago
parent
commit
ccef2f29da
  1. 3
      libisofs/builder.c
  2. 2
      libisofs/libisofs.h
  3. 4
      libisofs/messages.c

3
libisofs/builder.c

@ -215,6 +215,9 @@ int default_create_node(IsoNodeBuilder *builder, IsoImage *image,
}
}
break;
default:
ret = ISO_BAD_FSRC_FILETYPE;
goto ex;
}
if (ret < 0)

2
libisofs/libisofs.h

@ -8712,6 +8712,8 @@ int iso_conv_name_chars(IsoWriteOpts *opts, char *name, size_t name_len,
/** General note (NOTE, HIGH, -414) */
#define ISO_GENERAL_NOTE 0xB030FE62
/** Unrecognized file type of IsoFileSrc object (SORRY, HIGH, -415) */
#define ISO_BAD_FSRC_FILETYPE 0xE030FE61
/* Internal developer note:
Place new error codes directly above this comment.

4
libisofs/messages.c

@ -1,6 +1,6 @@
/*
* Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2009 - 2014 Thomas Schmitt
* Copyright (c) 2009 - 2015 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@ -541,6 +541,8 @@ const char *iso_error_to_msg(int errcode)
return "File name truncation length changed by loaded image info";
case ISO_GENERAL_NOTE:
return "A general note message was issued";
case ISO_BAD_FSRC_FILETYPE:
return "Unrecognized file type of IsoFileSrc object";
default:
return "Unknown error";
}

Loading…
Cancel
Save