From 874edd2ab76a1931a2d8efb81196c07aa346f650 Mon Sep 17 00:00:00 2001 From: John MacCallum Date: Sun, 16 Jul 2023 12:04:34 +0100 Subject: [PATCH] Fixed a crash that could occur (was occuring with o.timetag) when removing messages with duplicate addresses would encounter a message with a NULL address --- osc_bundle_u.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osc_bundle_u.c b/osc_bundle_u.c index 38d7575..3234705 100644 --- a/osc_bundle_u.c +++ b/osc_bundle_u.c @@ -259,7 +259,8 @@ static t_osc_err osc_bundle_u_addMsg_impl(t_osc_bndl_u *bndl, t_osc_msg_u *msg, t_osc_msg_u *m = bndl->msghead; while(m){ t_osc_msg_u *next = m->next; - if(!strcmp(address, osc_message_u_getAddress(m))){ + const char * const messageaddr = osc_message_u_getAddress(m); + if(messageaddr && !strcmp(address, messageaddr)){ osc_bundle_u_removeMsg(bndl, m); osc_message_u_free(m); bndl->msgcount--;