]> sigrok.org Git - libserialport.git/commitdiff
Fix a potential segfault in sp_get_port_handle().
authorUwe Hermann <redacted>
Thu, 30 Apr 2015 20:38:58 +0000 (22:38 +0200)
committerUwe Hermann <redacted>
Wed, 6 May 2015 15:06:05 +0000 (17:06 +0200)
serialport.c

index b98a65bd0d25cd3c16a7c96cefda1495a8de3ad0..80527be098a85eed8d624ce7ff8dd4e5dc594e12 100644 (file)
@@ -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;