yellowman / nsh

OpenBSD networking configuration shell
http://www.nmedia.net/nsh/
Other
177 stars 27 forks source link

Ndp.c fix Branch condition evaluates to a garbage value if(!nbi) #158

Closed smytht closed 2 months ago

smytht commented 2 months ago

Bug reported by the clang static analyzer.

Description: Branch condition evaluates to a garbage value File: /home/tom/nsh-master/nsh/ndp.c Line: 540

I compared ndp.c in nsh with ndp.c in opensd src.. I noticed that they do an

if(nbi) and else rather than 2 opposing if conditions so i went with that and moved the contents if if(!nbi) to the else block under if (nbi)

smytht commented 2 months ago

Resolved by initialising nbi variable