mirror of
https://repo.or.cz/socat.git
synced 2024-12-22 15:32:35 +00:00
AddressSanitizer reported a few buffer overflows (false positives)
This commit is contained in:
parent
40d9352599
commit
e25ba90e21
4 changed files with 15 additions and 8 deletions
4
CHANGES
4
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
|
||||
|
|
7
test.sh
7
test.sh
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue