Procházet zdrojové kódy

Fix PSV Studio warning

bel2125 před 5 roky
rodič
revize
05a293fb81
1 změnil soubory, kde provedl 6 přidání a 2 odebrání
  1. 6 2
      src/civetweb.c

+ 6 - 2
src/civetweb.c

@@ -7365,6 +7365,11 @@ mg_split_form_urlencoded(char *data,
 	int i;
 	int num = 0;
 
+	if (data == NULL) {
+		/* parameter error */
+		return -1;
+	}
+
 	if ((form_fields == NULL) && (num_form_fields == 0)) {
 		/* determine the number of expected fields */
 		if (data[0] == 0) {
@@ -7381,8 +7386,7 @@ mg_split_form_urlencoded(char *data,
 		return num;
 	}
 
-	if ((data == NULL) || (form_fields == NULL)
-	    || ((int)num_form_fields <= 0)) {
+	if ((form_fields == NULL) || ((int)num_form_fields <= 0)) {
 		/* parameter error */
 		return -1;
 	}