]> code.citadel.org Git - citadel.git/commitdiff
* Applied a patch submitted by <xperc@hotmail.com> to fix a potential buffer
authorArt Cancro <ajc@citadel.org>
Sat, 9 Mar 2002 22:52:04 +0000 (22:52 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 9 Mar 2002 22:52:04 +0000 (22:52 +0000)
  overflow problem in lprintf().  I also did the same fix to cprintf().

citadel/ChangeLog
citadel/commands.c
citadel/sysdep.c

index f146872751c5336e1ca91a8f296878ddfaa3c6ba..7572043d4c618c411f34745cb116f79e3b1ec33c 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 590.134  2002/03/09 22:52:04  ajc
+ * Applied a patch submitted by <xperc@hotmail.com> to fix a potential buffer
+   overflow problem in lprintf().  I also did the same fix to cprintf().
+
  Revision 590.133  2002/03/09 16:47:57  ajc
  * Added BMBX to fix a problem
 
@@ -3411,3 +3415,4 @@ 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 ea115ed15cce50effaaf1fdb7b63f8975d7849d6..089f7b176bc002b3fffef4121d94aa192bbc50ba 100644 (file)
@@ -179,7 +179,7 @@ void pprintf(const char *format, ...) {
  
        /* Otherwise, start spewing... */ 
         va_start(arg_ptr, format);   
-        vsprintf(buf, format, arg_ptr);   
+        vsnprintf(buf, sizeof(buf), format, arg_ptr);   
         va_end(arg_ptr);   
 
        for (i=0; i<strlen(buf); ++i) {
index 7e56a3bac9882028d04524203a23174193f902f7..fc545a15501396f139e7b174e1c574e358b4592f 100644 (file)
@@ -104,7 +104,7 @@ void lprintf(int loglevel, const char *format, ...) {
        char buf[SIZ];
   
         va_start(arg_ptr, format);   
-        vsprintf(buf, format, arg_ptr);   
+        vsnprintf(buf, sizeof(buf), format, arg_ptr);   
         va_end(arg_ptr);   
 
        if (loglevel <= verbosity) {