]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix potential NULL pointer dereference in final_maxfragmentlen()
authorAndrey Tsygunka <aitsygunka@yandex.ru>
Fri, 4 Apr 2025 11:58:40 +0000 (14:58 +0300)
committerMatt Caswell <matt@openssl.org>
Mon, 14 Apr 2025 14:55:43 +0000 (15:55 +0100)
commit4d682ffd4b79c396c6780863bedc9ec82068e316
tree089855621f13ac36a942aef0ac1bc0ce8ac5754d
parentcd4d10a3b7dcd46a3a2f01996cab4d2d8d2f3119
Fix potential NULL pointer dereference in final_maxfragmentlen()

In the final_maxfragmentlen() function, s->session is checked
for NULL after it was dereferenced earlier.
So move this NULL check to the top of the function.

CLA: trivial

Fixes: fa49560451 (Fix handling of max_fragment_length extension for PSK)
Signed-off-by: Andrey Tsygunka <aitsygunka@yandex.ru>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/27272)

(cherry picked from commit 28de1f5004c1083d358e6934552124a201e0251e)
ssl/statem/extensions.c