Module: kamailio Branch: master Commit: ef31c82ac3bd7972c2d02c893f8041af4664b717 URL: https://github.com/kamailio/kamailio/commit/ef31c82ac3bd7972c2d02c893f8041af...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2021-04-05T17:31:48+02:00
core: cfg.len - sanitizer safety check of target buffer
---
Modified: src/core/cfg.lex
---
Diff: https://github.com/kamailio/kamailio/commit/ef31c82ac3bd7972c2d02c893f8041af... Patch: https://github.com/kamailio/kamailio/commit/ef31c82ac3bd7972c2d02c893f8041af...
---
diff --git a/src/core/cfg.lex b/src/core/cfg.lex index afab5b68a5..b8e4f9aa70 100644 --- a/src/core/cfg.lex +++ b/src/core/cfg.lex @@ -1593,7 +1593,7 @@ static char* addchar(struct str_buf* dst, char c)
static char* addstr(struct str_buf* dst_b, char* src, int len) { - char *tmp; + char *tmp = NULL; unsigned size; unsigned used;
@@ -1612,6 +1612,10 @@ static char* addstr(struct str_buf* dst_b, char* src, int len) dst_b->crt=dst_b->s+used; dst_b->left=size-used; } + if(dst_b->crt==NULL) { + LM_CRIT("unexpected null dst buffer\n"); + ksr_exit(-1); + } memcpy(dst_b->crt, src, len); dst_b->crt+=len; *(dst_b->crt)=0;