root/trunk/texinfo/texinfo-4.7-segfault-1.patch

Revision 624, 5.8 kB (checked in by jim, 4 years ago)

Patch to fix segfault in texinfo

  • texinfo-4.7/info/echo-area.c

    old new  
    936936      printf_to_message_buffer (completions_found_index == 1 
    937937                                ? (char *) _("One completion:\n") 
    938938                                : (char *) _("%d completions:\n"), 
    939                                 (void *) completions_found_index, NULL, NULL); 
     939                                (void*)((intptr_t)completions_found_index), NULL, NULL); 
    940940 
    941941      /* Find the maximum length of a label. */ 
    942942      for (i = 0; i < completions_found_index; i++) 
     
    14991499   for input or a couple of seconds, whichever comes first.  Then flush the 
    15001500   informational message that was printed. */ 
    15011501void 
    1502 inform_in_echo_area (char *message) 
     1502inform_in_echo_area (const char *message) 
    15031503{ 
    1504   register int i; 
     1504  int i; 
    15051505  char *text; 
     1506  int avail = EA_MAX_INPUT + 1 - input_line_end; 
    15061507 
    15071508  text = xstrdup (message); 
    1508   for (i = 0; text[i] && text[i] != '\n'; i++) 
     1509  for (i = 0; text[i] && text[i] != '\n' && i < avail; i++) 
    15091510    ; 
    15101511  text[i] = 0; 
    15111512 
  • texinfo-4.7/info/echo-area.h

    old new  
    3333   killed some text. */ 
    3434extern int echo_area_last_command_was_kill; 
    3535 
    36 extern void inform_in_echo_area (char *message); 
     36extern void inform_in_echo_area (const char *message); 
    3737extern void echo_area_inform_of_deleted_window (WINDOW *window); 
    3838extern void echo_area_prep_read (void); 
    3939extern VFunction *ea_last_executed_command; 
  • texinfo-4.7/info/filesys.c

    old new  
    281281  if (!string || i >= strlen (string)) 
    282282    return NULL; 
    283283 
     284  if (!string[i]) /* end of string */ 
     285    return NULL; 
     286 
    284287  /* Advance to next PATH_SEP.  */ 
    285288  while (string[i] && string[i] != PATH_SEP[0]) 
    286289    i++; 
    287290 
    288   if (!string[i] && i == start) /* end of string, and didn't advance */ 
    289     return NULL; 
    290  
    291291  { 
    292292    char *value = xmalloc ((i - start) + 1); 
    293293    strncpy (value, &string[start], (i - start)); 
  • texinfo-4.7/info/infokey.c

    old new  
    639639                { 
    640640                  syntax_error (filename, lnum, 
    641641                      (char *) _("NUL character (^%c) not permitted"), 
    642                       (void *) c, NULL, NULL, NULL); 
     642                      (void *)((intptr_t)c), NULL, NULL, NULL); 
    643643                  error = 1; 
    644644                } 
    645645              seqstate = normal; 
     
    663663              if (alen == 0) 
    664664                { 
    665665                  syntax_error (filename, lnum, (char *) _("missing action name"), 
    666                       (void *) c, NULL, NULL, NULL); 
     666                      (void *)((intptr_t)c), NULL, NULL, NULL); 
    667667                  error = 1; 
    668668                } 
    669669              else 
  • texinfo-4.7/info/infomap.c

    old new  
    704704  map['H'].function = info_get_help_window; 
    705705  map['i'].function = info_index_search; 
    706706  map['I'].function = info_goto_invocation_node; 
    707   map['j'].function = info_down_line; 
    708   map['k'].function = info_up_line; 
     707  map['j'].function = info_next_line; 
     708  map['k'].function = info_prev_line; 
    709709  map['l'].function = info_history_node; 
    710710  map['m'].function = info_menu_item; 
    711711  map['n'].function = info_search_next; 
     
    11821182        'H', NUL,                       A_info_get_help_window, 
    11831183        'i', NUL,                       A_info_index_search, 
    11841184        'I', NUL,                       A_info_goto_invocation_node, 
    1185         'j', NUL,                       A_info_down_line, 
    1186         'k', NUL,                       A_info_up_line, 
     1185        'j', NUL,                       A_info_next_line, 
     1186        'k', NUL,                       A_info_prev_line, 
    11871187        'l', NUL,                       A_info_history_node, 
    11881188        'm', NUL,                       A_info_menu_item, 
    11891189        'n', NUL,                       A_info_search_next, 
  • texinfo-4.7/info/session.c

    old new  
    962962                     same as the first menu item found in this node. */ 
    963963                  window_message_in_echo_area 
    964964                    ((char *) _("Moving Up %d time(s), then Next."), 
    965                      (void *) up_counter, NULL); 
     965                     (void *)((intptr_t)up_counter), NULL); 
    966966 
    967967                  info_handle_pointer ("Next", window); 
    968968                  return; 
     
    19441944DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item")) 
    19451945{ 
    19461946  register int i, item; 
    1947   register REFERENCE *entry = NULL, **menu; 
     1947  register REFERENCE **menu; 
    19481948 
    19491949  menu = info_menu_of_node (window->node); 
    19501950 
     
    19621962    for (i = 0; menu[i + 1]; i++); 
    19631963  else 
    19641964    { 
    1965       for (i = 0; (entry = menu[i]); i++) 
     1965      for (i = 0; menu[i]; i++) 
    19661966        if (i == item - 1) 
    19671967          break; 
    19681968    } 
     
    19701970  if (menu[i]) 
    19711971    { 
    19721972      info_select_reference (window, menu[i]); 
    1973       if (entry->line_number > 0) 
    1974         info_next_line (window, entry->line_number - 1, key); 
     1973      if (menu[i]->line_number > 0) 
     1974        info_next_line (window, menu[i]->line_number - 1, key); 
    19751975    } 
    19761976  else 
    19771977    info_error ((char *) _("There aren't %d items in this menu."), 
    1978         (void *) item, NULL); 
     1978        (void *)((intptr_t)item), NULL); 
    19791979 
    19801980  info_free_references (menu); 
    19811981  return; 
Note: See TracBrowser for help on using the browser.