From 902bbfb04c6fcff9586b4428f86d4b9341eb9ffe Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Mon, 9 May 2011 11:19:01 +0000 Subject: [PATCH] Fix a segfault when abort_p is NULL. --- libnfc/buses/uart_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc/buses/uart_posix.c b/libnfc/buses/uart_posix.c index c320431..0698e5a 100644 --- a/libnfc/buses/uart_posix.c +++ b/libnfc/buses/uart_posix.c @@ -226,7 +226,7 @@ static const struct timeval tvTimeout = { int uart_receive (serial_port sp, byte_t * pbtRx, const size_t szRx, void * abort_p) { - int iAbortFd = *((int*)abort_p); + int iAbortFd = abort_p ? *((int*)abort_p) : 0; struct timeval tv = tvTimeout; struct timeval *ptv = &tv; int received_bytes_count = 0;