1. 14 Jul, 2011 2 commits
    • Paul Eggert's avatar
      Add Bug#. · 41f55ccd
      Paul Eggert authored
    • Paul Eggert's avatar
      * image.c: Improve checking for integer overflow. · ca4aa935
      Paul Eggert authored
      (check_image_size): Assume that f is nonnull, since
      it is always nonnull in practice.  This is one less thing to
      worry about when checking for integer overflow later.
      (x_check_image_size): New function, which checks for integer
      overflow issues inside X.
      (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
      This removes the need for a memory_full check.
      (xbm_image_p): Rewrite to avoid integer multiplication overflow.
      (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
      (xbm_read_bitmap_data): Change locals back to 'int', since
      their values must fit in 'int'.
      (xpm_load_image, png_load, tiff_load):
      Invoke x_create_x_image_and_pixmap earlier,
      to avoid much needless work if the image is too large.
      (tiff_load): Treat overly large images as if
      x_create_x_image_and_pixmap failed, not as malloc failures.
      (gs_load): Use x_check_image_size.
  2. 13 Jul, 2011 8 commits
  3. 12 Jul, 2011 8 commits
  4. 11 Jul, 2011 3 commits
  5. 10 Jul, 2011 5 commits
    • Johan Bockgård's avatar
    • Jan Djärv's avatar
      * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event · a560d974
      Jan Djärv authored
      for non-popups.
      Fixes: debbugs:3642
    • Andreas Schwab's avatar
      Protoize · 268c2c36
      Andreas Schwab authored
      * src/alloc.c (reset_malloc_hooks): Protoize.
      * src/cm.c (losecursor): Likewise.
      * src/ralloc.c (r_alloc_check): Likewise.
    • Andreas Schwab's avatar
      Protoize · 1dae0f0a
      Andreas Schwab authored
      * src/buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
      (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Protoize.
      * src/data.c (fmod): Likewise.
      * src/dispnew.c (swap_glyphs_in_rows): Likewise.
      * src/emacs.c (memory_warning_signal): Likewise.
      * src/floatfns.c (float_error): Likewise.
      * src/font.c (check_gstring, check_otf_features, otf_tag_symbol)
      (otf_open, font_otf_capability, generate_otf_features)
      (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
      * src/image.c (pbm_read_file): Likewise.
      * src/indent.c (string_display_width): Likewise.
      * src/intervals.c (check_for_interval, search_for_interval)
      (inc_interval_count, count_intervals, root_interval)
      (adjust_intervals_for_insertion, make_new_interval): Likewise.
      * src/lread.c (defalias): Likewise.
      * src/regex.c (set_image_of_range_1, set_image_of_range)
      (regex_grow_registers): Likewise.
      * src/sysdep.c (strerror): Likewise.
      * src/termcap.c (valid_filename_p, tprint, main): Likewise.
      * src/tparam.c (main): Likewise.
      * src/unexhp9k800.c (run_time_remap, save_data_space)
      (update_file_ptrs, read_header, write_header, calculate_checksum)
      (copy_file, copy_rest, display_header): Likewise.
      * src/widget.c (mark_shell_size_user_specified, create_frame_gcs):
      * src/xdisp.c (check_it): Likewise.
      * src/xfaces.c (register_color, unregister_color, unregister_colors):
      * src/xfns.c (print_fontset_result): Likewise.
      * src/xrdb.c (member, fatal, main): Likewise.
    • Paul Eggert's avatar
      Fix ChangeLog to reflect merge better. · 99033785
      Paul Eggert authored
  6. 09 Jul, 2011 6 commits
    • Juanma Barranquero's avatar
    • Jan Djärv's avatar
    • Paul Eggert's avatar
      * image.c: Integer signedness and overflow and related fixes. · 3f791afe
      Paul Eggert authored
      This is not an exhaustive set of fixes, but it's time to
      record what I've got.
      (lookup_pixel_color, check_image_size): Remove redundant decls.
      (check_image_size): Don't assume that arbitrary EMACS_INT values
      fit in 'int', or that arbitrary 'double' values fit in 'int'.
      (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
      (tiff_load, imagemagick_load_image):
      Check for overflow in size calculations.
      (x_create_x_image_and_pixmap): Remove unnecessary test for
      xmalloc returning NULL; that can't happen.
      (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
      (xpm_color_bucket): Use better integer hashing function.
      (xpm_cache_color): Don't possibly over-allocate memory.
      (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
      Use ptrdiff_t, not int or size_t, to record sizes.
      (png_load): Don't assume values greater than 2**31 fit in 'int'.
      (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
      either works, as we prefer signed integers.
      (tiff_read_from_memory, tiff_write_from_memory):
      Return tsize_t, not size_t, since that's what the TIFF API wants.
      (tiff_read_from_memory): Don't fail simply because the read would
      go past EOF; instead, return a short read.
      (tiff_load): Omit no-longer-needed casts.
      (Fimagemagick_types): Don't assume size fits into 'int'.
    • Eli Zaretskii's avatar
      Fix MS-Windows build broken by 2011-07-08T20:39:30Z!eggert@cs.ucla.edu. · 8278c4fe
      Eli Zaretskii authored
       src/w32.c (pthread_sigmask): New stub.
    • Paul Eggert's avatar
      Add Bug#. · 3d29b229
      Paul Eggert authored
    • Paul Eggert's avatar
      Fix minor problems found by static checking. · 5a9c4332
      Paul Eggert authored
      * chartab.c (char_table_set_range, map_sub_char_table)
      (uniprop_table_uncompress): Remove unused locals.
      (uniprop_table): Now static.
      * composite.c (_work_char): Remove unused static var.
      * gtkutil.c (qttip_cb): Remove stray no-effect statement.
  7. 08 Jul, 2011 8 commits
    • Jan Djärv's avatar
      Better fix that keeps corret margins in tooltip. · 1b854618
      Jan Djärv authored
      * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
      (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
      Fixes: debbugs:8591
    • Jan Djärv's avatar
      Don't let Gtk+ linewrap tooltips. · 0ce7e563
      Jan Djärv authored
      * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
      Put text in x->ttip_lbl instead of gtk_tooltip_set_text.
      (xg_hide_tooltip): Fix comment.
      Fixes: debbugs:8591
    • Jan Djärv's avatar
      Fix breakage introduced by fixing Bug#8842. · 3fe4b549
      Jan Djärv authored
      * nsfns.m (Fx_open_connection): Put NSStringPboardType into
      * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
      in registerServicesMenuSendTypes.
      (validRequestorForSendType): Don't check ns_return_types.
    • Jason Rumney's avatar
      * src/w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using · 5df75e47
      Jason Rumney authored
      frame struct members of non-existent frames.
      Fixes: debbugs:6284
    • Jan Djärv's avatar
      Fix warnings in ns*m files: Replace deprecated methods, declare new interfaces. · 4393663b
      Jan Djärv authored
      * emacs.c: Declare unexec_init_emacs_zone.
      * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
      to avoid warning.
      * nsimage.m (allocInitFromFile): Don't use deprecated method
      bestRepresentationForDevice on OSX >= 10.6.
      * nsmenu.m (fillWithWidgetValue): Don't use depercated method
      sizeToFit on OSX >= 10.2.
      * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
      cString and lossyCString on OSX >= 10.4
      * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
      (MAC_OS_X_VERSION_10_5): Define if not defined.
      (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
      (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
      (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
      * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
      variable firstTime not needed on OSX >= 10.6.
      (setPosition): setFloatValue:knobProportion: is deprecated on OSX
      >= 10.5.  Use setKnobProportion, setDoubleValue.
    • Jan Djärv's avatar
    • Jan Djärv's avatar
      Fix services menu empty on OSX 1.6+. · 699c10bd
      Jan Djärv authored
      * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
      (Fns_list_services): Just return Qnil on 10.6, code not working there.
      * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
      on svcsMenu.
      * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
      * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
      (ns_get_local_selection): Declare.
      * nsterm.m (QUTF8_STRING): Declare.
      (initFrameFromEmacs): Call registerServicesMenuSendTypes.
      (validRequestorForSendType): Return type is (id).
      Change indexOfObjectIdenticalTo to indexOfObject.
      Check if we have local selection before returning self (Bug#8842).
      (writeSelectionToPasteboard): Put local selection into paste board
      if we have a local selection (Bug#8842).
      (syms_of_nsterm): DEFSYM QUTF8_STRING.
    • Paul Eggert's avatar
      Improve hashing quality when configured --with-wide-int. · 3cc5a532
      Paul Eggert authored
      * fns.c (hash_string): New function, taken from sxhash_string.
      Do not discard information about ASCII character case; this
      discarding is no longer needed.
      (sxhash-string): Use it.  Change sig to match it.  Caller changed.
      * lisp.h: Declare it.
      * lread.c (hash_string): Remove, since we now use fns.c's version.
      The fns.c version returns a wider integer if --with-wide-int is
      specified, so this should help the quality of the hashing a bit.