Parcourir la source

C++ wrapper: getCookie fix for empty cookies

Fixes #1102
bel2125 il y a 2 ans
Parent
commit
23af667eb9
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  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;
 }