Commit bd27319
dns: Fix bug in error handling when talking to script
Comparing the result of read/write to a size_t value
is dangerous C. Since ssize_t and size_t have the same
size ssize_t is promoted to size_t, so -1 becomes
size_t max value and is not smaller than the expected
length.
Make sure to compare ssize_t to ssize_t to avoid any
suprises.
Change-Id: Ic395b6d1dce510bb4b499c5beba61f033a2a860b
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Heiko Hund <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1208
Message-Id: <[email protected]>
URL: https://sourceforge.net/p/openvpn/mailman/message/59238099/
Signed-off-by: Gert Doering <[email protected]>1 parent 945db23 commit bd27319
1 file changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
646 | 645 | | |
647 | 646 | | |
648 | 647 | | |
649 | | - | |
| 648 | + | |
650 | 649 | | |
651 | 650 | | |
652 | 651 | | |
| |||
665 | 664 | | |
666 | 665 | | |
667 | 666 | | |
668 | | - | |
669 | | - | |
| 667 | + | |
| 668 | + | |
670 | 669 | | |
671 | 670 | | |
672 | 671 | | |
| |||
727 | 726 | | |
728 | 727 | | |
729 | 728 | | |
730 | | - | |
| 729 | + | |
731 | 730 | | |
732 | 731 | | |
733 | 732 | | |
| |||
746 | 745 | | |
747 | 746 | | |
748 | 747 | | |
749 | | - | |
| 748 | + | |
750 | 749 | | |
751 | 750 | | |
752 | 751 | | |
| |||
0 commit comments