Преглед изворни кода

xhttp_pi: properly handle NULL values

Ovidiu Sas пре 12 година
родитељ
комит
3cfaf089c1
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      modules/xhttp_pi/xhttp_pi_fnc.c

+ 4 - 4
modules/xhttp_pi/xhttp_pi_fnc.c

@@ -2727,11 +2727,11 @@ int ph_run_pi_cmd(pi_ctx_t* ctx)
 					case DB1_STRING:
 					case DB1_BLOB:
 						if(values[j].val.str_val.s==NULL){
-							LM_ERR("NULL\n");
-							goto error;
+							val_str.s = NULL; val_str.len = 0;
+						} else {
+							val_str.s = values[j].val.str_val.s;
+							val_str.len = strlen(val_str.s);
 						}
-						val_str.s = values[j].val.str_val.s;
-						val_str.len = strlen(val_str.s);
 						LM_DBG("...got %.*s[%d]=>"
 							"[%.*s][%.*s]\n",
 							command->q_keys[j]->len,