From 8dc89ce4237fc5ffeccac37a0e5a883adb1514f5 Mon Sep 17 00:00:00 2001 From: Roman Khapov Date: Tue, 10 Dec 2024 15:05:05 +0500 Subject: [PATCH] machinarium/sources/tls.c: fix SIGSEGV (#725) mm_tls_read can have io without on_read Signed-off-by: rkhapov Co-authored-by: rkhapov --- third_party/machinarium/sources/tls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/machinarium/sources/tls.c b/third_party/machinarium/sources/tls.c index 5cdc5c60..117a2d5b 100644 --- a/third_party/machinarium/sources/tls.c +++ b/third_party/machinarium/sources/tls.c @@ -810,7 +810,7 @@ int mm_tls_read(mm_io_t *io, char *buf, int size) int rc; rc = SSL_read(io->tls_ssl, buf, size); if (rc > 0) { - if (mm_tls_read_pending(io)) { + if (io->on_read != NULL && mm_tls_read_pending(io)) { mm_cond_signal((mm_cond_t *)io->on_read, &mm_self->scheduler); }