On Fri, Nov 22, 2013 at 6:34 AM, Anton Blanchard <[email protected]> wrote:
[...]
> The code was tested. There are 0 occurences of LOG_WARN and 7 of
> LOG_WARNING in src/plugins/lanplus/lanplus.c.
>
I see. My bad then(it still should have been LOG_ERR, though).
> Also, 3 lines down from my patch we see:
>
> lprintf(LOG_WARNING, "Error in open session response
> message : %s\n",
>
Yup, this is wrong. lprintf() doesn't need '\n' unless you really want
double '\n' as a result.
> I used this as the basis of my patch. All of your concerns are here
> to be seen. It sounds like there is a lot of cleanup to do in this
> plugin if indeed all of this is incorrect.
There is a lots of cleaning up to do around ipmitool.
One more thing. Send patches as attachments. Since these are
"one-lines" they're easy to pick up. But I don't want to imagine doing
that with larger and more complex patch.
Z.
>
> Anton
> --
>
> Fix SEGV in ipmi_lanplus_open_session
>
> If ipmi_lanplus_send_payload fails we get a NULL pointer
> returned. Error out straight away instead of continuing on
> and getting a SEGV when we dereference rsp.
>
> diff --git a/src/plugins/lanplus/lanplus.c b/src/plugins/lanplus/lanplus.c
> index 1f8169e..0955b11 100644
> --- a/src/plugins/lanplus/lanplus.c
> +++ b/src/plugins/lanplus/lanplus.c
> @@ -2859,6 +2859,12 @@ ipmi_lanplus_open_session(struct ipmi_intf * intf)
> free(msg);
> msg = NULL;
>
> + if (!rsp)
> + {
> + lprintf(LOG_ERR, "Error sending open session message");
> + return -1;
> + }
> +
> if (verbose)
> lanplus_dump_open_session_response(rsp);
>
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Ipmitool-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel