From cfa35db086240ca07cc50e8fa9a9b7e6b16d4e03 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Mon, 22 Oct 2012 23:35:45 +0200 Subject: [PATCH] Fixed potential segmentation fault --- mbus/mbus-protocol-aux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mbus/mbus-protocol-aux.c b/mbus/mbus-protocol-aux.c index e655323..f91d246 100755 --- a/mbus/mbus-protocol-aux.c +++ b/mbus/mbus-protocol-aux.c @@ -1690,6 +1690,12 @@ mbus_sendrecv_request(mbus_handle *handle, int address, mbus_frame *reply, int m mbus_frame_data reply_data; mbus_frame *frame, *next_frame; int frame_count = 0, result; + + if (handle == NULL) + { + MBUS_ERROR("%s: Invalid M-Bus handle for request.\n", __PRETTY_FUNCTION__); + return 1; + } frame = mbus_frame_new(MBUS_FRAME_TYPE_SHORT);