[sr-dev] [kamailio/kamailio] ASAN: (Issue #2932)

sergey-safarov notifications at github.com
Sat Nov 13 17:50:01 CET 2021


I have compiled Kamailio with ASAN
When I start Kamailio I this error
```
core/re.c:390:2: runtime error: null pointer passed as argument 2, which is declared to never be null
```
[Link to code](https://github.com/kamailio/kamailio/blob/master/src/core/re.c#L390)


```
Breakpoint 1, replace_build (match=0xffffb0140fc0 "KZQ_CHECK_MEDIA_SERVER_INSERT", nmatch=1, pmatch=0xffffb01410a8, se=0xffffb00b9bc0, msg=0x332ebe0 <_faked_msg>, 
    rpl=0xffffb0141120) at core/re.c:390
390		RBUF_APPEND(dest, p, end-p);
(gdb) 
Continuing.

Breakpoint 1, replace_build (match=0xffffb0162a78 "auth_cache=>size=16;autoexpire=7200;REGISTRAR_S_WARM_CACHE", nmatch=1, pmatch=0xffffb0162b60, se=0xffffb0162730, 
    msg=0x332ebe0 <_faked_msg>, rpl=0xffffb0162bd8) at core/re.c:390
390		RBUF_APPEND(dest, p, end-p);
(gdb) p p
$4 = 0x0
(gdb) list
385				default:
386					LM_CRIT("unknown type %d\n", se->replace[r].type);
387					/* ignore it */
388			}
389		}
390		RBUF_APPEND(dest, p, end-p);
391		rpl->len = dest - rbuf;
392		if ((rpl->s = pkg_malloc(rpl->len)) == NULL) {
393			PKG_MEM_ERROR;
394			goto error;
(gdb) bt
#0  replace_build (match=0xffffb0162a78 "auth_cache=>size=16;autoexpire=7200;REGISTRAR_S_WARM_CACHE", nmatch=1, pmatch=0xffffb0162b60, se=0xffffb0162730, 
    msg=0x332ebe0 <_faked_msg>, rpl=0xffffb0162bd8) at core/re.c:390
#1  0x0000000000f91dc4 in subst_run (se=0xffffb0162730, input=0xffffb0162a78 "auth_cache=>size=16;autoexpire=7200;REGISTRAR_S_WARM_CACHE", msg=0x332ebe0 <_faked_msg>, 
    count=0x0) at core/re.c:460
#2  0x0000000000f926a0 in subst_str (input=0xffffb0162a78 "auth_cache=>size=16;autoexpire=7200;REGISTRAR_S_WARM_CACHE", msg=0x332ebe0 <_faked_msg>, se=0xffffb0162730, 
    count=0x0) at core/re.c:502
#3  0x00000000011e7d0c in pp_subst_run (data=0x338ba20 <s_buf>) at core/ppcfg.c:216
#4  0x00000000018b1f98 in yylex () at core/cfg.lex:1278
#5  0x0000000001900660 in yyparse () at core/cfg.tab.c:5160
#6  0x000000000048c4e4 in main (argc=11, argv=0xfffffffff3b8) at main.c:2487
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2932
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20211113/b22fca02/attachment.htm>


More information about the sr-dev mailing list