Changeset 156

Show
Ignore:
Timestamp:
05/20/99 14:14:48 (15 years ago)
Author:
ucaccsp
Message:

Some platforms don't have vsnprintf(), use vsprintf() as a replacement and
don't worry about buffer overflows.

Location:
common/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • common/trunk/MODS

    r155 r156  
    4848 
    4949v1.0.4  - Fix compilation with Microsoft IPv6 stack 
     50        - Solaris 2.5.1 doesn't have vsnprintf(), use vsprintf() instead 
     51          and don't worry about the possible buffer overflow problems.  
     52          Reported by Holger Wirtz. 
    5053 
    5154 
  • common/trunk/configure

    r98 r156  
    210210fi 
    211211 
     212${ECHO} "Searching for vsnprintf in <stdio.h>... \c" 
     213T1=`grep -c vsnprintf /usr/include/stdio.h` 
     214if [ $T1 = 0 ]; then 
     215        DEFS="$DEFS -DNEED_VSNPRINTF" 
     216        ${ECHO} "no - unsafe replacement enabled" 
     217else  
     218        ${ECHO} "yes" 
     219fi 
    212220 
    213221# Process options to the configure script... 
  • common/trunk/src/mbus.c

    r143 r156  
    5252#define MBUS_MAX_PD         10 
    5353#define MBUS_MAX_QLEN       50 /* Number of messages we can queue with mbus_qmsg() */ 
     54 
     55#ifdef NEED_VSNPRINTF 
     56int vsnprintf(char *s, int buf_size, const char *format, va_list ap) 
     57{ 
     58        /* Quick hack replacement for vsnprintf... note that this */ 
     59        /* doesm't check for buffer overflows, and so it open to  */ 
     60        /* many really nasty attacks!                             */ 
     61        return vsprintf(s,format,ap); 
     62} 
     63#endif 
    5464 
    5565struct mbus_key{