diff --git a/ripd/ripd.c b/ripd/ripd.c index 90dc7808eb..fa1188d625 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -902,7 +902,7 @@ static int rip_auth_md5(struct rip_packet *packet, struct sockaddr_in *from, return 0; key = key_lookup_for_accept(keychain, md5->keyid); - if (key == NULL) + if (key == NULL || key->string == NULL) return 0; strncpy(auth_str, key->string, RIP_AUTH_MD5_SIZE);