Fix crash in nfc-relay-picc -i/-t if fd3 or fd4 is missing
This commit is contained in:
parent
386e08d8b3
commit
4d0ee443d1
1 changed files with 8 additions and 2 deletions
|
@ -207,8 +207,14 @@ main(int argc, char *argv[])
|
||||||
ERR("No device found");
|
ERR("No device found");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
fd3 = fdopen(3, "r");
|
if ((fd3 = fdopen(3, "r")) == NULL) {
|
||||||
fd4 = fdopen(4, "w");
|
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 {
|
} else {
|
||||||
if (szFound < 2) {
|
if (szFound < 2) {
|
||||||
ERR("%zd device found but two opened devices are needed to relay NFC.", szFound);
|
ERR("%zd device found but two opened devices are needed to relay NFC.", szFound);
|
||||||
|
|
Loading…
Add table
Reference in a new issue