[Dnsmasq-discuss] [PATCH] Value stored to 'outmsgtype' is never read

Simon Kelley simon at thekelleys.org.uk
Wed Mar 15 21:18:11 UTC 2023


Yes, that's a bug.

I prefer to goto theend of the function rather than duplicate the scary 
code that sets the message type. By reordering some code there, the 
logging works better too.

https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=00be8b39e240934e404533deda08cbae2aae25a8


Cheers,

Simon.

On 14/03/2023 11:51, Petr Menšík wrote:
> Hi!
> 
> Our coverity scan detected new CLANG warning after I have cherry-picked 
> commit 03345ecefeb0d82e3c3a4c28f27c3554f0611b39 [1] into our rhel8 
> release. It reported it for 2.79 version, but even the last commit in 
> master branch still has the same issue present. In attached patch I have 
> suggested fix.
> 
> I am not sure how to trigger this code from the client, so this is not 
> tested with real dhcp client. I track it under Fedora bug [2]. Coverity 
> reported it as:
> 
> 1. Defect type: CLANG_WARNING
> 1. dnsmasq-2.79/src/rfc3315.c:344:7: warning[deadcode.DeadStores]: Value stored to 'outmsgtype' is never read
> #   342|
> #   343|       {
> #   344|->       outmsgtype = DHCP6REPLY;
> #   345|         o1 = new_opt6(OPTION6_STATUS_CODE);
> #   346|         put_opt6_short(DHCP6USEMULTI);
> 
> 1. 
> http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=03345ecefeb0d82e3c3a4c28f27c3554f0611b39
> 2. https://bugzilla.redhat.com/show_bug.cgi?id=2178069
> 
> -- 
> Petr Menšík
> Software Engineer, RHEL
> Red Hat,http://www.redhat.com/
> PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss



More information about the Dnsmasq-discuss mailing list