Skip to content

Commit

Permalink
Merge pull request #7593 from WalterBright/fix18190
Browse files Browse the repository at this point in the history
fix Issue 18190 - [asan] heap-buffer-overflow in Module.load.checkMod…
merged-on-behalf-of: Mike Franklin <JinShil@users.noreply.github.com>
  • Loading branch information
dlang-bot authored Jan 4, 2018
2 parents df0de47 + 959f39f commit 7ddec7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dmd/dmodule.d
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/dmodule.d, _dmodule.d)
* Documentation: https://dlang.org/phobos/dmd_dmodule.html
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/dmodule.d
*/

module dmd.dmodule;

// Online documentation: https://dlang.org/phobos/dmd_dmodule.html

import core.stdc.stdio;
import core.stdc.stdlib;
import core.stdc.string;
Expand Down Expand Up @@ -463,7 +463,7 @@ extern (C++) final class Module : Package
const m = (*ms)[j];
const q = strchr(m, '=');
assert(q);
if (dotmods.offset <= q - m && memcmp(dotmods.peekString(), m, q - m) == 0)
if (dotmods.offset == q - m && memcmp(dotmods.peekString(), m, q - m) == 0)
{
buf.reset();
auto qlen = strlen(q + 1);
Expand Down

0 comments on commit 7ddec7d

Please sign in to comment.