Skip to content

Commit

Permalink
Strip quotes from org name in Maxmind DB
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag committed Jul 22, 2024
1 parent 4804dbf commit 9fb15d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/maxmind/mmcreate.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ static int loadASV4tree(char *fileName) {
asOrgNode_t asOrgNode = {.as = asV4Node.as};
field = sep;

size_t fieldLen = strlen(field);
if (fieldLen > 2) {
if (field[fieldLen - 1] == '"') field[fieldLen - 1] = '\0';
if (field[0] == '"') field++;
}

// extract org name
strncpy(asV4Node.orgName, field, orgNameLength);
asV4Node.orgName[orgNameLength - 1] = '\0';
Expand Down

0 comments on commit 9fb15d1

Please sign in to comment.