diff --git a/CHANGES b/CHANGES index 4424f21..9d899b1 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,10 @@ corrections: Tests: SYSTEM_RC EXEC_RC Issue reported by Felix Winkelmann. + AddressSanitizer reported a few buffer overflows (false positives). + Nevertheless fixed Socat source. + Issue reported by Hanno Böck. + porting: Type conflict between int and sig_atomic_t between declaration and definition of diag_immediate_type and diag_immediate_exit broke diff --git a/test.sh b/test.sh index 480362c..e4306be 100755 --- a/test.sh +++ b/test.sh @@ -2700,11 +2700,14 @@ $CMD1 $tf 2>"${te}1" & bg=$! # background process id waitfile "$ts" echo "$da" |$CMD2 >>"$tf" 2>>"${te}2" -if [ $? -ne 0 ]; then +rc2=$? +if [ "$rc2" -ne 0 ]; then $PRINTF "$FAILED: $TRACE $SOCAT:\n" echo "$CMD1 &" echo "$CMD2" - cat "$te" + echo "rc=$rc2" + cat "${te}1" + cat "${te}2" numFAIL=$((numFAIL+1)) listFAIL="$listFAIL $N" elif ! echo "$da" |diff - "$tf" >"$tdiff"; then diff --git a/xio-gopen.c b/xio-gopen.c index c193baa..2753fed 100644 --- a/xio-gopen.c +++ b/xio-gopen.c @@ -90,9 +90,9 @@ static int xioopen_gopen(int argc, const char *argv[], struct opt *opts, int xio return result; #ifdef I_PUSH if (S_ISCHR(st_mode)) { - Ioctl(result, I_PUSH, "ptem"); - Ioctl(result, I_PUSH, "ldterm"); - Ioctl(result, I_PUSH, "ttcompat"); + Ioctl(result, I_PUSH, "ptem\0\0\0"); /* pad string length ... */ + Ioctl(result, I_PUSH, "ldterm\0"); /* ... to requirements of ... */ + Ioctl(result, I_PUSH, "ttcompat"); /* ... AdressSanitizer */ } #endif fd->stream.fd = result; diff --git a/xio-progcall.c b/xio-progcall.c index 2ee7721..1196cf4 100644 --- a/xio-progcall.c +++ b/xio-progcall.c @@ -252,9 +252,9 @@ int _xioopen_foxec(int xioflags, /* XIO_RDONLY etc. */ /* AIX: I_PUSH def'd; pty: ioctl(, I_FIND, ...) -> 1 */ /* SunOS: I_PUSH def'd; pty: ioctl(, I_FIND, ...) -> 0 */ /* HP-UX: I_PUSH def'd; pty: ioctl(, I_FIND, ...) -> 0 */ - if (Ioctl(ttyfd, I_FIND, "ldterm") == 0) { - Ioctl(ttyfd, I_PUSH, "ptem"); /* 0 */ - Ioctl(ttyfd, I_PUSH, "ldterm"); /* 0 */ + if (Ioctl(ttyfd, I_FIND, "ldterm\0") == 0) { + Ioctl(ttyfd, I_PUSH, "ptem\0\0\0"); /* 0 */ /* padding for AdressSanitizer */ + Ioctl(ttyfd, I_PUSH, "ldterm\0"); /* 0 */ Ioctl(ttyfd, I_PUSH, "ttcompat"); /* HP-UX: -1 */ } #endif