Module: kamailio Branch: master Commit: 2f29115d8280ccf04ea823d5cf8f6621b8624edc URL: https://github.com/kamailio/kamailio/commit/2f29115d8280ccf04ea823d5cf8f6621b8624edc
Author: Daniel-Constantin Mierla <[email protected]> Committer: Daniel-Constantin Mierla <[email protected]> Date: 2017-07-31T15:54:27+02:00 auth_identity: code clarity adjustments --- Modified: src/modules/auth_identity/auth_hdrs.c --- Diff: https://github.com/kamailio/kamailio/commit/2f29115d8280ccf04ea823d5cf8f6621b8624edc.diff Patch: https://github.com/kamailio/kamailio/commit/2f29115d8280ccf04ea823d5cf8f6621b8624edc.patch --- diff --git a/src/modules/auth_identity/auth_hdrs.c b/src/modules/auth_identity/auth_hdrs.c index 0947f5e9a1..24d2ab395f 100644 --- a/src/modules/auth_identity/auth_hdrs.c +++ b/src/modules/auth_identity/auth_hdrs.c @@ -471,7 +471,11 @@ int digeststr_asm(dynstr *sout, struct sip_msg *msg, str *sdate, int iflags) LOG(L_ERR, "AUTH_IDENTITY:digeststr_asm: DATE header is not found\n"); return -9; } + break; } + if (app2dynstr(sout,&sact)) + return -10; + break; default: if (iRes==AUTH_NOTFOUND) break; @@ -514,13 +518,14 @@ int append_hf(struct sip_msg* msg, char *str1, enum _hdr_types_t type) len=strlen(str1); - s = (char*)pkg_malloc(len); + s = (char*)pkg_malloc(len+1); if (!s) { LOG(L_ERR, "AUTH_IDENTITY:append_hf: No memory left\n"); return -1; } memcpy(s, str1, len); + s[len] = '\0'; if (insert_new_lump_before(anchor, s, len, type) == 0) { LOG(L_ERR, "AUTH_IDENTITY:append_hf: Can't insert lump\n"); @@ -643,6 +648,8 @@ static char *auth_get_hf_name(char *begin, char *end, enum _hdr_types_t *type) p += 4; goto dc_end; } + *type = HDR_OTHER_T; + break; default: /* compact headers */ switch(LOWER_BYTE(*p)) { @@ -656,6 +663,8 @@ static char *auth_get_hf_name(char *begin, char *end, enum _hdr_types_t *type) *type = HDR_CONTACT_T; return (p + 2); } + *type = HDR_OTHER_T; + break; default: *type = HDR_OTHER_T; break; _______________________________________________ Kamailio (SER) - Development Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
