Skip to content

Commit d0f9286

Browse files
committed
[libromdata] EXEPrivate::findNERuntimeDLL(): Fix an off-by-one error.
Found using aflplusplus-4.40c.
1 parent d5aa675 commit d0f9286

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/libromdata/Other/EXE_NE.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* EXE_NE.cpp: DOS/Windows executable reader. *
44
* 16-bit New Executable format. *
55
* *
6-
* Copyright (c) 2016-2025 by David Korth. *
6+
* Copyright (c) 2016-2026 by David Korth. *
77
* Copyright (c) 2022 by Egor. *
88
* SPDX-License-Identifier: GPL-2.0-or-later *
99
***************************************************************************/
@@ -259,8 +259,8 @@ int EXEPrivate::findNERuntimeDLL(string &refDesc, string &refLink, bool &refHasK
259259
}
260260

261261
const uint8_t count = static_cast<uint8_t>(ne_imported_name_table[nameOffset]);
262-
assert(nameOffset + 1 + count <= ne_imported_name_table.size());
263-
if (nameOffset + 1 + count > ne_imported_name_table.size()) {
262+
assert(nameOffset + 1 + count < ne_imported_name_table.size());
263+
if (nameOffset + 1 + count >= ne_imported_name_table.size()) {
264264
// Out of range.
265265
// TODO: Return an error?
266266
break;

0 commit comments

Comments
 (0)