head 1.1; access; symbols; locks; strict; comment @ * @; 1.1 date 2026.11.09.05.37.22; author jnemeth; state Exp; branches; next ; commitid nfklAD0yCz3anK2H; desc @@ 1.1 log @comms/asterisk24: import asterisk-24.0.0 Asterisk is a complete PBX in software. It provides all of the features you would expect from a PBX and more. Asterisk does voice over IP in three protocols, and can interoperate with almost all standards-based telephony equipment using relatively inexpensive hardware. Asterisk provides Voicemail services with Directory, Call Conferencing, Interactive Voice Response, Call Queuing. It has support for three-way calling, caller ID services, ADSI, SIP and H.323 (as both client and gateway). This is a Long Term Support version. It is scheduled to go to security fixes only on October 15th, 2030, and EOL on October 15th, 2031. See here for more information about Asterisk versions: https://docs.asterisk.org/About-the-Project/Asterisk-Versions/ @ text @$NetBSD: patch-res_res__xmpp.c,v 1.1 2025/10/27 06:58:40 jnemeth Exp $ --- res/res_xmpp.c.orig 2025-05-22 16:00:51.000000000 +0000 +++ res/res_xmpp.c @@@@ -62,6 +62,15 @@@@ #include "asterisk/config_options.h" #include "asterisk/json.h" + +/* XXX, pthread_equal() is misused to compare non-valid thread pointers */ +static int +pt_pthread_equal(pthread_t t1, pthread_t t2) +{ + return t1 == t2; +} + + /*** DOCUMENTATION @@@@ -3653,7 +3662,7 @@@@ static int xmpp_action_hook(void *data, int ast_xmpp_client_disconnect(struct ast_xmpp_client *client) { - if ((client->thread != AST_PTHREADT_NULL) && !pthread_equal(pthread_self(), client->thread)) { + if ((client->thread != AST_PTHREADT_NULL) && !pt_pthread_equal(pthread_self(), client->thread)) { xmpp_client_change_state(client, XMPP_STATE_DISCONNECTING); pthread_cancel(client->thread); pthread_join(client->thread, NULL); @@@@ -3795,7 +3804,7 @@@@ static int xmpp_client_receive(struct as /* if we stumble on the ending tag character, we skip any whitespace that follows it*/ if (c == '>') { - while (isspace(buf[pos+1])) { + while (isspace((unsigned char)buf[pos+1])) { pos++; } } @