Commit 4d0ee443 authored by Philippe Teuwen's avatar Philippe Teuwen

Fix crash in nfc-relay-picc -i/-t if fd3 or fd4 is missing

parent 386e08d8
......@@ -207,8 +207,14 @@ main(int argc, char *argv[])
ERR("No device found");
return EXIT_FAILURE;
}
fd3 = fdopen(3, "r");
fd4 = fdopen(4, "w");
if ((fd3 = fdopen(3, "r")) == NULL) {
ERR("Could not open file descriptor 3");
return EXIT_FAILURE;
}
if ((fd4 = fdopen(4, "r")) == NULL) {
ERR("Could not open file descriptor 4");
return EXIT_FAILURE;
}
} else {
if (szFound < 2) {
ERR("%zd device found but two opened devices are needed to relay NFC.", szFound);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment