### Description
I have compiled Kamailio with google ASAN module and faced issue where the string PV with
NULL value cannot be copied.
Using GDB I found this function call triggers error when Google ASAN is used,
`value->s.s = NULL`, `value->s.len = 0`
```
memcpy(var->v.value.s.s, value->s.s, value->s.len);
```
[
Link](https://github.com/kamailio/kamailio/blob/caccb13e29ee12166c8101efa0d…
This happens only when ASAN is used.
Without ASAN same function call with the same values does not trigger an error.
In my test case this function called from
[`lost/functions.c:1285`](https://github.com/kamailio/kamailio/blob/caccb13e29ee12166c8101efa0d5ab2745876413/src/modules/lost/functions.c#L1285)
To compile with asan used extra flags
```
-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all
-fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null
-fno-sanitize=alignment
```
### Troubleshooting
#### Log Messages
```
0(913407) INFO: {1 1 INVITE 1-455779(a)172.21.0.84} lost [functions.c:891]:
lost_function(): ### LOST urn [urn:sip:911@3.236.25.254:5060]
0(913407) INFO: {1 1 INVITE 1-455779(a)172.21.0.84} lost [functions.c:983]:
lost_function(): ### LOST loc [<112233445566(a)jim.com>]
0(913407) ERROR: {1 1 INVITE 1-455779(a)172.21.0.84} lost [utilities.c:336]:
lost_get_content(): could not get XML node content
pv_svar.c:137:3: runtime error: null pointer passed as argument 2, which is declared to
never be null
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
current master, test 375f86b69e11cf835ae919873d3cd56f32d589c8
* **Operating System**:
Centos 8
--
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/2913