]> git.ipfire.org Git - people/sennis/libloc.git/commitdiff
12321 change strlen to strnlen as suggested by flawfinder. 12321
authorSimon <simon.ennis@ipfire.org>
Thu, 26 Mar 2020 23:16:46 +0000 (23:16 +0000)
committerSimon <simon.ennis@ipfire.org>
Thu, 26 Mar 2020 23:16:46 +0000 (23:16 +0000)
src/country.c

index 45d26b82ef49dd156df61b6d66555185c37e5f33..1ca188ca038597b0ee0bdfe906a8b2918c297c7f 100644 (file)
@@ -179,7 +179,7 @@ LOC_EXPORT int loc_country_code_is_valid(const char* cc) {
                return 0;
 
        // It must be 2 characters long
-       if (strlen(cc) != 2)
+       if (strnlen(cc,3) != 2)
                return 0;
 
        // It must only contain A-Z