Explorar el Código

C++ wrapper: getCookie fix for empty cookies

Fixes #1102
bel2125 hace 2 años
padre
commit
23af667eb9
Se han modificado 1 ficheros con 3 adiciones y 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;
 }