From: Uwe Hermann Date: Thu, 30 Apr 2015 20:38:58 +0000 (+0200) Subject: Fix a potential segfault in sp_get_port_handle(). X-Git-Tag: libserialport-0.1.1~43 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5f64c28551d7ee7dbecf5215cb75d63c3cf8303b;p=libserialport.git Fix a potential segfault in sp_get_port_handle(). --- diff --git a/serialport.c b/serialport.c index b98a65b..80527be 100644 --- a/serialport.c +++ b/serialport.c @@ -234,6 +234,8 @@ SP_API enum sp_return sp_get_port_handle(const struct sp_port *port, if (!port) RETURN_ERROR(SP_ERR_ARG, "Null port"); + if (!result_ptr) + RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); #ifdef _WIN32 HANDLE *handle_ptr = result_ptr;