Commit 3de589ed authored by Jan Včelák's avatar Jan Včelák 🚀

coverity fix: snprintf unchecked value

CID: 1269290
parent 77b5b9ea
......@@ -450,9 +450,8 @@ static bool key_match(const dnssec_key_t *key, const char *search)
// keytag exact match
char keytag[10] = { 0 };
snprintf(keytag, sizeof(keytag), "%d", dnssec_key_get_keytag(key));
if (strcmp(search, keytag) == 0) {
int len = snprintf(keytag, sizeof(keytag), "%d", dnssec_key_get_keytag(key));
if (len > 0 && strcmp(search, keytag) == 0) {
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment