Merge pull request #2763 from lyq140/master

ripd: null check the key string
This commit is contained in:
Donald Sharp 2018-08-01 07:56:50 -04:00 committed by GitHub
commit aa0b1d3b60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);