]> code.citadel.org Git - citadel.git/commitdiff
* Repaired the problems I created when moving the_mime_parser()'s variables
authorArt Cancro <ajc@citadel.org>
Sun, 13 Jan 2002 04:06:33 +0000 (04:06 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 13 Jan 2002 04:06:33 +0000 (04:06 +0000)
  from the stack to the heap.  (Hint: sizeof(char *) is 4, not 4096)

citadel/ChangeLog
citadel/mime_parser.c
citadel/sysdep.c

index 2674d168bb1f9df7fd4d8be1add84a9417bec53e..c16b7cc17c2d80e3aa39835520213ed774c35c5a 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 590.58  2002/01/13 04:06:33  ajc
+ * Repaired the problems I created when moving the_mime_parser()'s variables
+   from the stack to the heap.  (Hint: sizeof(char *) is 4, not 4096)
+
  Revision 590.57  2002/01/11 15:46:57  error
  * Allow users to move/copy messages between personal rooms
 
@@ -3139,4 +3143,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index c552722fafc0fb9702fb904f34edac697b435261..5162d1c46e3b4c37d7e90572e4f39a121596ef9b 100644 (file)
@@ -333,7 +333,7 @@ void the_mime_parser(char *partnum,
        /* Learn interesting things from the headers */
        strcpy(header, "");
        do {
-               ptr = memreadline(ptr, buf, sizeof buf);
+               ptr = memreadline(ptr, buf, SIZ);
                if (ptr >= content_end) {
                        goto end_parser;
                }
@@ -362,7 +362,7 @@ void the_mime_parser(char *partnum,
                                extract_key(boundary, header, "boundary");
                        strcpy(header, "");
                }
-               if ((strlen(header) + strlen(buf) + 2) < sizeof(header))
+               if ((strlen(header) + strlen(buf) + 2) < SIZ)
                        strcat(header, buf);
        } while ((strlen(buf) > 0) && (*ptr != 0));
 
@@ -421,7 +421,7 @@ void the_mime_parser(char *partnum,
                                                        userdata,
                                                        dont_decode);
                                }
-                               ptr = memreadline(ptr, buf, sizeof(buf));
+                               ptr = memreadline(ptr, buf, SIZ);
                                part_start = ptr;
                        }
                        else {
index e8d741c598591e18cda066b27d544bcc69d19aea..3acb63d99d2e12f52552d664fe7b2bb4c378c262 100644 (file)
@@ -101,7 +101,7 @@ pthread_t initial_thread;           /* tid for main() thread */
  */
 void lprintf(int loglevel, const char *format, ...) {   
         va_list arg_ptr;
-       char buf[4096];
+       char buf[SIZ];
   
         va_start(arg_ptr, format);   
         vsprintf(buf, format, arg_ptr);