فهرست منبع

Fix clang analyzer warning due to possible use of uninitialized variables

Kevin Wojniak 10 سال پیش
والد
کامیت
6c27b96db3
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      src/civetweb.c

+ 3 - 0
src/civetweb.c

@@ -2507,6 +2507,9 @@ static int pull(FILE *fp, struct mg_connection *conn, char *buf, int len)
     double timeout = -1;
     struct timespec start, now;
 
+    memset(&start, 0, sizeof(start));
+    memset(&now, 0, sizeof(now));
+
     if (conn->ctx->config[REQUEST_TIMEOUT]) {
         timeout = atoi(conn->ctx->config[REQUEST_TIMEOUT]) / 1000.0;
     }