]> granicus.if.org Git - php/commitdiff
@- Workaround for bogus POST-Data from IE/Mac. (Thies)
authorThies C. Arntzen <thies@php.net>
Sat, 12 Feb 2000 17:37:11 +0000 (17:37 +0000)
committerThies C. Arntzen <thies@php.net>
Sat, 12 Feb 2000 17:37:11 +0000 (17:37 +0000)
@  Patch by Alain Malek <alain@virtua.ch>
fix #2944

main/rfc1867.c

index 459d65d7ea5be2eea808c6b9e1393de45c98d5bb..e9c430c1e591d8305962848ebf9c0b6b16725cdd 100644 (file)
@@ -37,6 +37,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary)
 {
        char *ptr, *loc, *loc2, *s, *name, *filename, *u, *fn;
        int len, state = 0, Done = 0, rem, urem;
+       int eolsize;
        long bytes, max_file_size = 0;
        char *namebuf=NULL, *filenamebuf=NULL, *lbuf=NULL;
        FILE *fp;
@@ -64,8 +65,13 @@ static void php_mime_split(char *buf, int cnt, char *boundary)
                                        if (!strncmp(loc, boundary, len)) {
 
                                                state = 1;
-                                               rem -= (loc - ptr) + len + 2;
-                                               ptr = loc + len + 2;
+
+                                               eolsize = 2;
+                                               if(*(loc+len)==0x0a)
+                                                       eolsize = 1;
+
+                                               rem -= (loc - ptr) + len + eolsize;
+                                               ptr = loc + len + eolsize;
                                        } else {
                                                rem -= (loc - ptr) + 1;
                                                ptr = loc + 1;