AddressSanitizer reported a few buffer overflows (false positives)

This commit is contained in:
Gerhard Rieger 2017-01-06 17:56:30 +01:00
parent 40d9352599
commit e25ba90e21
4 changed files with 15 additions and 8 deletions

View file

@ -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

View file

@ -2700,11 +2700,14 @@ $CMD1 </dev/null >$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

View file

@ -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;

View file

@ -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