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.
---
 src/plugins/lanplus/lanplus.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/plugins/lanplus/lanplus.c b/src/plugins/lanplus/lanplus.c
index 1f8169e..9ce9945 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_WARNING, "Error sending open session message\n");
+               return -1;
+       }
+
        if (verbose)
                lanplus_dump_open_session_response(rsp);
 
-- 
1.8.3.2


------------------------------------------------------------------------------
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
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to