Skip to content

Commit

Permalink
fix Issue 18190 - [asan] heap-buffer-overflow in Module.load.checkMod…
Browse files Browse the repository at this point in the history
…FileAlias
  • Loading branch information
WalterBright committed Jan 4, 2018
1 parent df0de47 commit 959f39f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dmd/dmodule.d
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 959f39f

Please sign in to comment.