Fix stack overflow in string creation (Bug#6214).
authorChong Yidong <cyd@stupidchicken.com>
Tue, 18 May 2010 18:05:43 +0000 (14:05 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Tue, 18 May 2010 18:05:43 +0000 (14:05 -0400)
* character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to
prevent stack overflow if number of arguments is too large
(Bug#6214).

1  2 
src/ChangeLog

diff --cc src/ChangeLog
 -2010-05-11  Eli Zaretskii  <eliz@gnu.org>
+ 2010-05-18  Chong Yidong  <cyd@stupidchicken.com>
+       * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to
+       prevent stack overflow if number of arguments is too large
+       (Bug#6214).
 +2010-05-18  Juanma Barranquero  <lekktu@gmail.com>
  
 -      * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(SRC)/w32.h.
 +      * charset.c (load_charset_map_from_file): Don't call close after fclose.
  
 -      * w32fns.c: Include w32.h.
 -      (Fw32_shell_execute): Decode the error message before passing it
 -      to `error'.  (Bug#6126)
 +2010-05-18  Glenn Morris  <rgm@gnu.org>
 +
 +      * s/gnu-linux.h: Combine two conditionals.
 +
 +      * Makefile.in (otherobj): Include $(VMLIMIT_OBJ) separately from
 +      $(POST_ALLOC_OBJ).
 +
 +      * Makefile.in (RALLOC_OBJ): New, set by configure.
 +      (rallocobj): Replace with the previous variable.
 +      (otherobj): Use $RALLOC_OBJ.
 +
 +      * s/gnu.h (REL_ALLOC) [DOUG_LEA_MALLOC]:
 +      * s/gnu-linux.h (REL_ALLOC) [DOUG_LEA_MALLOC]: Move undef to configure.
 +
 +      * Makefile.in (GMALLOC_OBJ, VMLIMIT_OBJ): New, set by configure.
 +      (gmallocobj, vmlimitobj): Replace with previous two variables.
 +      (otherobj): Use $GMALLOC_OBJ, $VMLIMIT_OBJ.
 +
 +2010-05-17  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (OLDXMENU_DEPS): New, set by configure.
 +      (stamp-oldxmenu): Use $OLDXMENU_DEPS.
 +
 +2010-05-16  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (${ns_appbindir}Emacs, ns-app): Always define these rules.
 +
 +      * Makefile.in (clean): Get rid of HAVE_NS conditional.
 +
 +      * Makefile.in (ns_appdir, ns_appbindir): Now configure adds the
 +      trailing "/".
 +
 +      * Makefile.in (TEMACS_LDFLAGS2): New, set by configure.
 +      (temacs${EXEEXT}): Combine the NS_IMPL_GNUSTEP case with the default.
 +
 +      * Makefile.in (GNUSTEP_SYSTEM_LIBRARIES): Remove, unused.
 +      (NS_IMPL_GNUSTEP_TEMACS_LDFLAGS): New, set by configure.
 +      (LD) [NS_IMPL_GNUSTEP]: Set to $(CC) -rdynamic.
 +      (temacs${EXEEXT}): Remove $LOCALCPP, never defined or referenced.
 +      Make most of the NS_IMPL_GNUSTEP case the same as the default case.
 +
 +      * Makefile.in (temacs${EXEEXT}) [!NS_IMPL_GNUSTEP]:
 +      Remove ${STARTFLAGS}, nothing ever sets it.
 +
 +2010-05-16  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * m/ia64.h (UNEXEC): Remove, set in s/*.h.
 +
 +2010-05-16  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (LIBX_BASE): Always define.
 +
 +      * Makefile.in (LIBX_OTHER): Move out of cpp section.
 +
 +      * Makefile.in (LIBXT): Always define.
 +
 +2010-05-15  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (OLDXMENU, LIBXMENU, LIBX_OTHER): Always define.
 +
 +      * Makefile.in (FONT_DRIVERS): Remove, replace with $FONT_OBJ.
 +      (obj, SOME_MACHINE_OBJECTS): Use $FONT_OBJ.
 +
 +2010-05-15  Ken Raeburn  <raeburn@raeburn.org>
 +
 +      * lisp.h (XFLOAT_DATA): Use "0?x:x" to generate an rvalue.  (Bug#5916)
 +      (LISP_MAKE_RVALUE) [!USE_LISP_UNION_TYPE && !__GNUC__]: Likewise.
 +
 +      * emacs.c (main): Initialize initial-environment and
 +      process-environment before generating from env, not after.
 +
 +      Handle --version reasonably in CANNOT_DUMP configuration.
 +      * emacs.c (emacs_version, emacs_copyright): New string variables.
 +      (Vemacs_version, Vemacs_copyright): New Lisp_Object variables.
 +      (syms_of_emacs): Defvar them, and initialize them from the C
 +      string variables.
 +      (main): If initialization hasn't been done, print initial version
 +      info from the C strings, instead of starting an interactive session.
 +
 +2010-05-15  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_paragraph_init): Don't leave alone garbage values
 +      of bidi_it->paragraph_dir.  Call bidi_initialize if needed.
 +      (bidi_paragraph_init): Remove redundant assertion that we are at
 +      the beginning of a line after call to bidi_find_paragraph_start.
 +
 +      * xdisp.c (Fcurrent_bidi_paragraph_direction): New function.
 +      (syms_of_xdisp): Defsubr it.
 +
 +      * Makefile.in: Fix MSDOS-related comments.
 +
 +2010-05-15  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (OLDXMENU_TARGET): New, set by configure.
 +      (really-lwlib, really-oldXMenu): Always define.
 +      ($OLDXMENU): Depend on $OLDXMENU_TARGET.
 +
 +      * Makefile.in: Simplify cpp conditional.
 +
 +      * Makefile.in (${ns_appdir}): Simplify using umask.
 +
 +      * Makefile.in (${ns_appdir}): Remove references to CVS-related files.
 +
 +2010-05-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * eval.c (specbind): Remove left-over duplicate test.
 +      Disallow let-binding frame-local vars.  Add comment.
 +
 +2010-05-14  Eli Zaretskii  <eliz@gnu.org>
 +
 +      Make the cache of bidi iterator states dynamically allocated.
 +      * bidi.c (bidi_cache_shrink): New function.
 +      (bidi_init_it): Call it.
 +      (bidi_cache_iterator_state): Enlarge the cache if needed.
 +
 +      * bidi.c (bidi_move_to_visually_next): Rename from
 +      bidi_get_next_char_visually.  All callers changed.
 +
 +2010-05-14  Kenichi Handa  <handa@m17n.org>
 +
 +      * dispextern.h (struct composition_it): New member reversed_p.
 +
 +      * composite.c (composition_compute_stop_pos): Search backward if
 +      ENDPOS < CHARPOS.
 +      (composition_reseat_it): Handle the case that ENDPOS < CHARPOS.
 +      Set CMP_IT->reversed_p.
 +      (composition_update_it): Pay attention to CMP_IT->reversed_p.
 +
 +      * xdisp.c (set_iterator_to_next):
 +      Call composition_compute_stop_pos with negative ENDPOS if we are
 +      scanning backward.  Call composition_compute_stop_pos if scan
 +      direction is changed.
 +      (next_element_from_buffer): Call composition_compute_stop_pos with
 +      negative ENDPOS if we are scanning backward.
 +      (next_element_from_composition): Pay attention to
 +      IT->cmp_it.reversed_p.
 +
 +2010-05-14  Kenichi Handa  <handa@m17n.org>
 +
 +      * font.c (font_range): Return the range for the font found at first.
 +
 +2010-05-14  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Always define.
 +
 +      * Makefile.in (mktime, X11, register): Move undefs to configure.
 +
 +      * Makefile.in (MSDOS_OBJ): Default to empty, let msdos scripts set it.
 +      (MSDOS_X_OBJ): New variable.
 +      (MSDOS_SUPPORT_REAL): New constant.
 +      (MSDOS_SUPPORT): Set as a variable, not with cpp.
 +      (obj): Use MSDOS_X_OBJ.
 +      (lisp): Use MSDOS_SUPPORT as a variable.
 +
 +      * Makefile.in (REAL_MOUSE_SUPPORT): New constant.
 +      (GPM_MOUSE_SUPPORT): Now it's a constant.
 +      (MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): Set with configure,
 +      not cpp.
 +
 +      * Makefile.in (@NS_IMPL_GNUSTEP_INC@): Use in place of #ifdef.
 +      (ns_appresdir): Remove, unused.
 +
 +      * Makefile.in (SHELL): Move outside cpp section.
 +
 +      * s/netbsd.h (AMPERSAND_FULL_NAME): Remove (defined in AH_BOTTOM).
 +
 +2010-05-13  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (FONT_DRIVERS): Place with other HAVE_X_WINDOWS stuff.
 +      (TOOLTIP_SUPPORT): Place with other HAVE_WINDOW_SYSTEM stuff.
 +
 +      * Makefile.in (FONT_DRIVERS): If HAVE_X_WINDOWS is defined,
 +      HAVE_WINDOW_SYSTEM must be too.
 +
 +      * Makefile.in (WINNT_SUPPORT): Remove, nt build does not use this file.
 +      (lisp): Remove WINNT_SUPPORT.
 +
 +      * Makefile.in (OLDXMENU, LIBXMENU) [!HAVE_MENUS]:
 +      Let configure set these variables (to empty) in this case as well.
 +
 +      * Makefile.in (LD_SWITCH_X_SITE): Define as a variable, not via cpp.
 +      (LIBX_BASE): Use $LD_SWITCH_X_SITE.
 +
 +      * Makefile.in (C_SWITCH_X_SYSTEM, C_SWITCH_X_SITE, LIB_STANDARD)
 +      (LIB_MATH, FONTCONFIG_CFLAGS, FONTCONFIG_LIBS, FREETYPE_CFLAGS)
 +      (FREETYPE_LIBS, LIBOTF_CFLAGS, LIBOTF_LIBS, M17N_FLT_CFLAGS)
 +      (M17N_FLT_LIBS, GNU_OBJC_CFLAGS, GNUSTEP_SYSTEM_LIBRARIES, LIBGPM)
 +      (LIBRESOLV, UNEXEC_OBJ): For clarity, define variables to hold
 +      the values output by configure.
 +      (ALL_CFLAGS, obj, LIBES, temacs${EXEEXT}): Use the above variables.
 +
 +2010-05-12  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (YMF_PASS_LDFLAGS, LD, LINKER): Simplify the logic.
 +      (LINKER_WAS_SPECIFIED): Remove.
 +
 +      * Makefile.in (LIB_GCC): Set using configure, not cpp.
 +      (GNULIB_VAR) [!ORDINARY_LINK]: Always set to $LIB_GCC.
 +      * m/arm.h (LIB_GCC) [GNU_LINUX]:
 +      * s/cygwin.h (LIB_GCC):
 +      * s/freebsd.h (LIB_GCC):
 +      * s/gnu-linux.h (LIB_GCC):
 +      * s/msdos.h (LIB_GCC):
 +      * s/netbsd.h (LIB_GCC):
 +      Move to configure.
  
  2010-05-11  Karel Klic  <kklic@redhat.com>