Skip to content

Commit

Permalink
pua_usrloc: Do not crash during usrloc sync
Browse files Browse the repository at this point in the history
... on the backup box, due to `current_processing_context` being NULL.

Thanks to Pete Kelly for reporting and testing!

(cherry picked from commit be5c5e5)
  • Loading branch information
liviuchircu committed Nov 22, 2019
1 parent aa89b87 commit b0d05ce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/pua_usrloc/ul_publish.c
Expand Up @@ -44,8 +44,13 @@ int pul_status_idx = -1;
#define ctx_pul_set(_val) \
context_put_int( CONTEXT_GLOBAL, current_processing_ctx, pul_status_idx, _val)

#define ctx_pul_get() \
context_get_int( CONTEXT_GLOBAL, current_processing_ctx, pul_status_idx)
static inline int ctx_pul_get(void)
{
if (!current_processing_ctx)
return 0;

return context_get_int(CONTEXT_GLOBAL, current_processing_ctx, pul_status_idx);
}


int pua_set_publish(struct sip_msg* msg , char* s1, char* s2)
Expand Down

0 comments on commit b0d05ce

Please sign in to comment.