]> granicus.if.org Git - php/commitdiff
Potential trap when cookies are sent
authorSam Ruby <rubys@php.net>
Sun, 20 Feb 2000 13:43:51 +0000 (13:43 +0000)
committerSam Ruby <rubys@php.net>
Sun, 20 Feb 2000 13:43:51 +0000 (13:43 +0000)
sapi/servlet/servlet.c

index f29a8946a619eb5621b86ddd87e925500f81a758..800e503eb6c581b9629498479d34d7e3618e65d3 100644 (file)
@@ -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_bytes<count_bytes) buffer[read_bytes]=0;
 
        (*jenv)->ReleaseStringUTFChars(jenv, post, postAsUTF);