mirror of
git://sigrok.org/libserialport
synced 2023-08-10 21:13:24 +03:00
Fix a potential segfault in sp_get_config_*().
This commit is contained in:
parent
5f64c28551
commit
6aad5bdd47
@ -2117,6 +2117,8 @@ SP_API enum sp_return sp_set_##x(struct sp_port *port, type x) { \
|
|||||||
SP_API enum sp_return sp_get_config_##x(const struct sp_port_config *config, \
|
SP_API enum sp_return sp_get_config_##x(const struct sp_port_config *config, \
|
||||||
type *x) { \
|
type *x) { \
|
||||||
TRACE("%p, %p", config, x); \
|
TRACE("%p, %p", config, x); \
|
||||||
|
if (!x) \
|
||||||
|
RETURN_ERROR(SP_ERR_ARG, "Null result pointer"); \
|
||||||
if (!config) \
|
if (!config) \
|
||||||
RETURN_ERROR(SP_ERR_ARG, "Null config"); \
|
RETURN_ERROR(SP_ERR_ARG, "Null config"); \
|
||||||
*x = config->x; \
|
*x = config->x; \
|
||||||
|
Loading…
Reference in New Issue
Block a user