X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=serialport.c;h=80527be098a85eed8d624ce7ff8dd4e5dc594e12;hb=5f64c28551d7ee7dbecf5215cb75d63c3cf8303b;hp=b98a65bd0d25cd3c16a7c96cefda1495a8de3ad0;hpb=1b91c6eadbcbd2356441920c11c9385083b93e91;p=libserialport.git 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;