~cdemu/cdemu/master

Viewing all changes in revision 1818.

  • Committer: Rok Mandeljc
  • Date: 2020-06-28 17:13:10 UTC
  • Revision ID: git-v1:a3c1a208e409fb6a3030d011cbe6f9df9cff434b
libMirage: NRG parser: avoid using strlen() to determine if MCN/ISRC is set

The MCN and ISRC fields in the NRG image are fixed-width (i.e., *not*
 NULL terminated), so if they are set, strlen() tends to run across
the array boundary (but it then stops at subsequent fields, which
is why this behavior tends to go unnoticed).

Replaced the strlen() check with checking only the first byte of
the string field.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: