pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.512 2003/08/03 01:01:37 mast Exp $ + || $Id: program.c,v 1.513 2003/08/04 16:14:21 mast Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.512 2003/08/03 01:01:37 mast Exp $"); + RCSID("$Id: program.c,v 1.513 2003/08/04 16:14:21 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_macros.h"   #include "fsort.h"
pike.git/src/program.c:5532:    return NULL;   }      void my_yyerror(char *fmt,...) ATTRIBUTE((format(printf,1,2)))   {    va_list args;    char buf[8192];       va_start(args,fmt);    - #ifdef HAVE_VSNPRINTF -  vsnprintf(buf, 8190, fmt, args); - #else /* !HAVE_VSNPRINTF */ -  VSPRINTF(buf, fmt, args); - #endif /* HAVE_VSNPRINTF */ +  VSNPRINTF (buf, sizeof (buf), fmt, args);       if((size_t)strlen(buf) >= (size_t)sizeof(buf))    Pike_fatal("Buffer overflow in my_yyerror.\n");       yyerror(buf);    va_end(args);   }      void yy_describe_exception(struct svalue *thrown)   {
pike.git/src/program.c:7219:    va_list args;       /* If we have parse errors we might get erroneous warnings,    * so don't print them.    * This has the additional benefit of making it easier to    * visually locate the actual error message.    */    if (Pike_compiler->num_parse_error) return;       va_start(args,fmt); -  VSPRINTF(buf, fmt, args); +  VSNPRINTF (buf, sizeof (buf), fmt, args);    va_end(args);    -  if(strlen(buf)>sizeof(buf)) -  Pike_fatal("Buffer overflow in yywarning!\n"); -  +     if ((error_handler && error_handler->prog) || get_master()) {    ref_push_string(lex.current_file);    push_int(lex.current_line);    push_text(buf);       low_safe_apply_handler("compile_warning", error_handler, compat_handler, 3);    pop_stack();    }   }