Explorar o código

C++ wrapper: getCookie fix for empty cookies

Fixes #1102
bel2125 %!s(int64=2) %!d(string=hai) anos
pai
achega
23af667eb9
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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;
 }