Преглед на файлове

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;
 }