[gnutls-devel] GnuTLS | `gnutls_hash_output(..., NULL)` leads to SIGSEGV (#1769)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Mon Dec 1 19:35:56 CET 2025



Barnabás Pőcze created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1769



## Description of problem:

`gnutls_hash_output(..., NULL)` can lead to SIGSEGV


## Version of gnutls used:

* 3.8.11

## Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)

* Arch Linux


## How reproducible:

Steps to Reproduce:

 * just doing the call triggers it every time (at least on my machine)

## Actual results:

```
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bd3fcd in _nettle_write_be32 (length=<optimized out>, dst=0x0, src=0x5555555c0d40) at /usr/src/debug/nettle/nettle-3.10.2/write-be32.c:54
54	    WRITE_UINT32(dst, src[i]);
(gdb) bt full
#0  0x00007ffff7bd3fcd in _nettle_write_be32 (length=<optimized out>, dst=0x0, src=0x5555555c0d40) at /usr/src/debug/nettle/nettle-3.10.2/write-be32.c:54
        i = <optimized out>
        words = 8
        leftover = 0
#1  0x00007ffff7bd7f25 in nettle_sha256_digest (ctx=0x5555555c0d40, length=<optimized out>, digest=<optimized out>) at /usr/src/debug/nettle/nettle-3.10.2/sha256.c:156
No locals.
#2  0x00007ffff6b491fa in wrap_x86_hash_output (src_ctx=<optimized out>, digest=<optimized out>, digestsize=<optimized out>) at accelerated/x86/sha-x86-ssse3.c:329
        ctx = <optimized out>
        __func__ = "wrap_x86_hash_output"
[...]
```



## Expected results:

The hash state is reset as indicated in the documentation.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1769
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/20251201/c7310dee/attachment.html>


More information about the Gnutls-devel mailing list