From 8583ab7c9aaff066a45e477c9c25d921a02ce923 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 28 May 2008 09:14:07 -0700 Subject: Handle empty auth string properly Compiler warned about dubious code where test was: char auth_str[]; ... if (!auth_str) return 0; Looks like what was meant was testing for empty auth string. --- ripd/ripd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ripd/ripd.c b/ripd/ripd.c index c5e42705..62d8691c 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -926,7 +926,7 @@ rip_auth_md5 (struct rip_packet *packet, struct sockaddr_in *from, else if (ri->auth_str) strncpy (auth_str, ri->auth_str, RIP_AUTH_MD5_SIZE); - if (! auth_str) + if (auth_str[0] == 0) return 0; /* MD5 digest authentication. */ -- cgit v1.2.3