Private
Public Access
2
0

initio.c: Add fix for passing null pointer as argument

Signed-off-by: Adelin Dobre <adelin.dobre@rinftech.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Adelin Dobre
2019-01-07 14:55:13 +02:00
committed by Mihai Tudor Panu
parent 88a8bb22b6
commit 8ded6f1f6d

View File

@@ -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;