소스 검색

siputils: allocate enough space to hold ending zero for tel uri in tel2sip()

- reported by Juha Heinanen
Daniel-Constantin Mierla 11 년 전
부모
커밋
7992a2b8d4
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      modules/siputils/checks.c

+ 1 - 1
modules/siputils/checks.c

@@ -354,7 +354,7 @@ int tel2sip(struct sip_msg* _msg, char* _uri, char* _hostpart, char* _res)
     if (strncasecmp(uri.s, "tel:", 4) != 0) return 1;
     
     /* reserve memory for clean tel uri */
-    tel_uri.s = pkg_malloc(uri.len);
+    tel_uri.s = pkg_malloc(uri.len+1);
     if (tel_uri.s == 0) {
 	LM_ERR("no more pkg memory\n");
 	return -1;