소스 검색

- check if the lump parameter is NULL to avoid segmentation fault

Daniel-Constantin Mierla 22 년 전
부모
커밋
9976cb2537
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      data_lump_rpl.c

+ 1 - 1
data_lump_rpl.c

@@ -69,7 +69,7 @@ int add_lump_rpl(struct sip_msg * msg, struct lump_rpl* lump)
 {
 {
 	struct lump_rpl *foo;
 	struct lump_rpl *foo;
 
 
-	if (lump->text.s==0 || lump->text.len==0) {
+	if (lump==0 || lump->text.s==0 || lump->text.len==0) {
 		LOG(L_ERR,"ERROR:add_lump_rpl: I won't add an empty lump!\n");
 		LOG(L_ERR,"ERROR:add_lump_rpl: I won't add an empty lump!\n");
 		return -1;
 		return -1;
 	}
 	}