From cd6e167982615cdf6cc529c8b15d4b84c0058fa3 Mon Sep 17 00:00:00 2001 From: Greg King Date: Fri, 4 Jan 2019 02:29:17 -0500 Subject: [PATCH] Fixed a duplicate-label test. Don't call strcmp() if either argument is NULL. --- src/da65/labels.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/da65/labels.c b/src/da65/labels.c index 6aa7f38cf..97e195ebf 100644 --- a/src/da65/labels.c +++ b/src/da65/labels.c @@ -92,7 +92,9 @@ static void AddLabel (unsigned Addr, attr_t Attr, const char* Name) ** have a name (you guessed that, didn't you?). */ if (ExistingAttr == Attr && - ((Name == 0 && SymTab[Addr] == 0) || strcmp (SymTab[Addr], Name) == 0)) { + ((Name == 0 && SymTab[Addr] == 0) || + (Name != 0 && SymTab[Addr] != 0 && + strcmp (SymTab[Addr], Name) == 0))) { return; } Error ("Duplicate label for address $%04X: %s/%s", Addr, SymTab[Addr], Name); -- 2.39.5