]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_outbound_publish: Fix crash when publishing device state. 69/4269/1
authormkrokosz <mkrokosz@vonage.com>
Fri, 28 Oct 2016 18:30:02 +0000 (14:30 -0400)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 1 Nov 2016 18:38:02 +0000 (13:38 -0500)
While publishing device state between multiple instances of Asterisk,
a crash will sporadically occur under high CPS which looks to be a
race condition operating on the publisher queue.

ASTERISK-26506

Change-Id: I28da25d346deb358eff1d563485cabc433ce1ed6

res/res_pjsip_outbound_publish.c

index 0aad5fcdb643939e220b09fe9c1cb7e9308b78a8..87680480c8f172530bac85ec7ed10e9b443f703e 100644 (file)
@@ -786,6 +786,7 @@ static int publisher_client_send(void *obj, void *arg, void *data, int flags)
        struct sip_outbound_publish_message *message;
        size_t type_len = 0, subtype_len = 0, body_text_len = 0;
        int *res = data;
+       SCOPED_AO2LOCK(lock, publisher);
 
        *res = -1;
        if (!publisher->client) {