Pārlūkot izejas kodu

Fix possibly uninitialized variable 'mime_vec' reported by Coverity.

Kimmo Mustonen 8 gadi atpakaļ
vecāks
revīzija
9058a373c9
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      src/civetweb.c

+ 3 - 0
src/civetweb.c

@@ -6655,6 +6655,9 @@ get_mime_type(struct mg_context *ctx, const char *path, struct vec *vec)
 	path_len = strlen(path);
 
 	if (ctx == NULL || vec == NULL) {
+		if (vec != NULL) {
+			memset(vec, '\0', sizeof(struct vec));
+		}
 		return;
 	}