From 8ded6f1f6dfe11f560cc3ce00bb874ff056ebade Mon Sep 17 00:00:00 2001 From: Adelin Dobre Date: Mon, 7 Jan 2019 14:55:13 +0200 Subject: [PATCH] initio.c: Add fix for passing null pointer as argument Signed-off-by: Adelin Dobre Signed-off-by: Mihai Tudor Panu --- src/initio/initio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/initio/initio.c b/src/initio/initio.c index 66ec2ca..1181c6c 100644 --- a/src/initio/initio.c +++ b/src/initio/initio.c @@ -171,7 +171,7 @@ parse_uart(char** proto, size_t n, const char* proto_full) /* Check for bytesize. */ int bytesize = -1; - if (mraa_atoi_x(proto[idx], &end, &bytesize, 0) != MRAA_SUCCESS) { + if (proto[idx] != NULL && mraa_atoi_x(proto[idx], &end, &bytesize, 0) != MRAA_SUCCESS) { syslog(LOG_ERR, "parse_uart: error reading uart bytesize '%d' from '%s'", bytesize, proto_full); mraa_uart_stop(dev); return NULL;