Skip to content

Commit 0e8ae12

Browse files
committed
fieldClassifier: bugfix: asn overflow after saved to uint16
changelog: Bugfixes in <fieldClassifier>.
1 parent 77aeaa3 commit 0e8ae12

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • modules/fieldClassifier/src/plugins

modules/fieldClassifier/src/plugins/asn.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void ASN::storeParameters(argparse::ArgumentParser& parser)
3030
FieldDefinition ASN::defineFields()
3131
{
3232
// list of all fields provided by this plugin
33-
FieldDefinition allFields = {{"ASN", DataType::UINT16}, {"ASO", DataType::STRING}};
33+
FieldDefinition allFields = {{"ASN", DataType::UINT32}, {"ASO", DataType::STRING}};
3434

3535
return allFields;
3636
}
@@ -53,7 +53,7 @@ bool ASN::getData(DataMap& dataMap, std::string& ipAddr)
5353
}
5454
if (dataMap.find("ASN") != dataMap.end()) {
5555
err = MMDB_get_value(&result.entry, &entryData, "autonomous_system_number", NULL);
56-
dataMap.at("ASN") = checkEntryData() ? entryData.uint16 : EMPTY_UINT16;
56+
dataMap.at("ASN") = checkEntryData() ? entryData.uint32 : EMPTY_UINT16;
5757
}
5858
if (dataMap.find("ASO") != dataMap.end()) {
5959
err = MMDB_get_value(&result.entry, &entryData, "autonomous_system_organization", NULL);

0 commit comments

Comments
 (0)