[Replicant] [libsamsung-ipc][PATCH 3/6] ipc_device_detect: handle read errors

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Thu Feb 6 16:26:30 UTC 2020


Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 samsung-ipc/ipc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c
index 2512d29..39caf0b 100644
--- a/samsung-ipc/ipc.c
+++ b/samsung-ipc/ipc.c
@@ -68,6 +68,8 @@ int ipc_device_detect(void)
         goto error;
 
     length = read(fd, &buffer, sizeof(buffer));
+    if (length == -1)
+      goto error;
 
     close(fd);
 
-- 
2.25.0



More information about the Replicant mailing list