Mercurial > dropbear
comparison dbutil.c @ 1383:f03cfe9c76ac fuzz
Disable setnonblocking(), get_socket_address(), set_sock_priority()
for fuzzing
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 26 May 2017 22:10:51 +0800 |
parents | d8215479a58a |
children | 6c92e97553f1 |
comparison
equal
deleted
inserted
replaced
1382:4b864fd12b22 | 1383:f03cfe9c76ac |
---|---|
529 | 529 |
530 void setnonblocking(int fd) { | 530 void setnonblocking(int fd) { |
531 | 531 |
532 TRACE(("setnonblocking: %d", fd)) | 532 TRACE(("setnonblocking: %d", fd)) |
533 | 533 |
534 #ifdef DROPBEAR_FUZZ | |
535 if (fuzz.fuzzing) { | |
536 return; | |
537 } | |
538 #endif | |
539 | |
534 if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) { | 540 if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) { |
535 if (errno == ENODEV) { | 541 if (errno == ENODEV) { |
536 /* Some devices (like /dev/null redirected in) | 542 /* Some devices (like /dev/null redirected in) |
537 * can't be set to non-blocking */ | 543 * can't be set to non-blocking */ |
538 TRACE(("ignoring ENODEV for setnonblocking")) | 544 TRACE(("ignoring ENODEV for setnonblocking")) |
539 } else { | 545 } else { |
540 #ifdef DROPBEAR_FUZZ | 546 { |
541 if (fuzz.fuzzing) | 547 dropbear_exit("Couldn't set nonblocking"); |
542 { | 548 } |
543 TRACE(("fuzzing ignore setnonblocking failure for %d", fd)) | |
544 } | |
545 else | |
546 #endif | |
547 { | |
548 dropbear_exit("Couldn't set nonblocking"); | |
549 } | |
550 } | 549 } |
551 } | 550 } |
552 TRACE(("leave setnonblocking")) | 551 TRACE(("leave setnonblocking")) |
553 } | 552 } |
554 | 553 |