فهرست منبع

C++ wrapper: getCookie fix for empty cookies

Fixes #1102
bel2125 2 سال پیش
والد
کامیت
23af667eb9
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      src/CivetServer.cpp

+ 3 - 1
src/CivetServer.cpp

@@ -561,7 +561,9 @@ CivetServer::getCookie(struct mg_connection *conn,
 	                          _cookieValue,
 	                          sizeof(_cookieValue));
 	cookieValue.clear();
-	cookieValue.append(_cookieValue);
+	if (lRead >= 0) {
+		cookieValue.append(_cookieValue);
+	}
 	return lRead;
 }