[gnutls-devel] GnuTLS | lib/iov.c:119: null pointer passed as argument 2 to memcpy() (#882)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Sat Dec 21 19:57:01 CET 2019



Tim Rühsen created an issue: https://gitlab.com/gnutls/gnutls/issues/882



Running the commands in !1136 for the runner `UB+ASAN-Werror.Fedora.x86_64.gcc` stop with the error/backtrace below.

*If* memcpy checks for NULL, nothing would happen. But if not, we would see a segmentation fault.

```
tim at ryzen:~/src/gnutls$ cat tests/slow/test-ciphers.sh.log 
iov.c:119:3: runtime error: null pointer passed as argument 2, which is declared to never be null
    #0 0x7f99d24b1f5b in _gnutls_iov_iter_next /home/tim/src/gnutls/lib/iov.c:119
    #1 0x7f99d2469482 in gnutls_aead_cipher_encryptv /home/tim/src/gnutls/lib/crypto-api.c:1043
    #2 0x7f99d249995b in test_cipher_aead_scatter /home/tim/src/gnutls/lib/crypto-selftests.c:1028
    #3 0x7f99d249995b in test_cipher_aead /home/tim/src/gnutls/lib/crypto-selftests.c:1292
    #4 0x7f99d24a04d8 in gnutls_cipher_self_test /home/tim/src/gnutls/lib/crypto-selftests.c:1889
    #5 0x555e1ea0e310 in main /home/tim/src/gnutls/tests/slow/cipher-test.c:45
    #6 0x7f99d15aabba in __libc_start_main ../csu/libc-start.c:308
    #7 0x555e1ea0e199 in _start (/home/tim/src/gnutls/tests/slow/cipher-test+0x1199)

default cipher tests failed
FAIL test-ciphers.sh (exit status: 1)
tim at ryzen:~/src/gnutls$ cat tests/slow/override-ciphers.log 
iov.c:119:3: runtime error: null pointer passed as argument 2, which is declared to never be null
    #0 0x7f574b5c3f5b in _gnutls_iov_iter_next /home/tim/src/gnutls/lib/iov.c:119
    #1 0x7f574b57b482 in gnutls_aead_cipher_encryptv /home/tim/src/gnutls/lib/crypto-api.c:1043
    #2 0x7f574b5ab95b in test_cipher_aead_scatter /home/tim/src/gnutls/lib/crypto-selftests.c:1028
    #3 0x7f574b5ab95b in test_cipher_aead /home/tim/src/gnutls/lib/crypto-selftests.c:1292
    #4 0x7f574b5b2501 in gnutls_cipher_self_test /home/tim/src/gnutls/lib/crypto-selftests.c:1892
    #5 0x5583cd9f8c45 in main /home/tim/src/gnutls/tests/slow/cipher-override.c:228
    #6 0x7f574a681bba in __libc_start_main ../csu/libc-start.c:308
    #7 0x5583cd9f82e9 in _start (/home/tim/src/gnutls/tests/slow/.libs/cipher-override+0x32e9)

overridden cipher tests failed
FAIL override-ciphers (exit status: 1)
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/882
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20191221/673e0e3d/attachment-0001.html>


More information about the Gnutls-devel mailing list