diff options
author | Ermal Luçi <eri@FreeBSD.org> | 2015-07-09 16:28:36 +0000 |
---|---|---|
committer | Ermal Luçi <eri@FreeBSD.org> | 2015-07-09 16:28:36 +0000 |
commit | 56844a6203a1fad30cc35dcd1eee2e97d0113ea2 (patch) | |
tree | 4dd03df9f1d786f52589855d217da7524749b6ad /sys/netinet/ip_input.c | |
parent | 7b7254e71f972e6c1b254e3652eeecf3447fbd03 (diff) | |
download | src-56844a6203a1fad30cc35dcd1eee2e97d0113ea2.tar.gz src-56844a6203a1fad30cc35dcd1eee2e97d0113ea2.zip |
Correct issue presented in r285051,
apparently neither clang nor gcc complain about this.
But clang intis the var to NULL correctly while gcc on at least mips does not.
Correct the undefined behavior by initializing the variable properly.
PR: 201371
Differential Revision: https://reviews.freebsd.org/D3036
Reviewed by: gnn
Approved by: gnn(mentor)
Notes
Notes:
svn path=/head/; revision=285325
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 49e8b4289d1d..4140edac5460 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -941,7 +941,8 @@ ip_forward(struct mbuf *m, int srcrt) if (ro.ro_rt != NULL) { ia = ifatoia(ro.ro_rt->rt_ifa); ifa_ref(&ia->ia_ifa); - } + } else + ia = NULL; #ifndef IPSEC /* * 'ia' may be NULL if there is no route for this destination. |