From: Sam Ruby Date: Sun, 20 Feb 2000 13:43:51 +0000 (+0000) Subject: Potential trap when cookies are sent X-Git-Tag: php-4.0b4~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a7909c9834f568535e6b4102ddcb7249437e9bc;p=php Potential trap when cookies are sent --- diff --git a/sapi/servlet/servlet.c b/sapi/servlet/servlet.c index f29a8946a6..800e503eb6 100644 --- a/sapi/servlet/servlet.c +++ b/sapi/servlet/servlet.c @@ -181,7 +181,8 @@ static int sapi_servlet_read_post(char *buffer, uint count_bytes SLS_DC) uint read_bytes=(*jenv)->GetStringLength(jenv, post); if (read_bytes>count_bytes) read_bytes=count_bytes; - memcpy(buffer, postAsUTF, count_bytes); + memcpy(buffer, postAsUTF, read_bytes); + if (read_bytesReleaseStringUTFChars(jenv, post, postAsUTF);