Changeset f98c74e for functions.c


Ignore:
Timestamp:
Apr 5, 2009, 7:36:53 PM (15 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
owl
Children:
51b6c7c
Parents:
9948234
Message:
Fix some strcpy's that could be vulnerable
Remove an unused function
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    re01449c rf98c74e  
    290290{
    291291  owl_editwin *e;
    292   char buff[1024];
     292  char *buff;
    293293  owl_zwrite z;
    294294  int ret;
     
    320320  owl_editwin_clear(e);
    321321  owl_editwin_set_dotsend(e);
    322   strcpy(buff, "----> ");
    323   strcat(buff, line);
    324   strcat(buff, "\n");
     322  buff=owl_sprintf("----> %s\n", line);
    325323  owl_editwin_set_locktext(e, buff);
    326324
    327   /* make it active */
    328325  owl_global_set_typwin_active(&g);
    329326
    330327  owl_global_set_buffercommand(&g, line);
     328  owl_free(buff);
    331329}
    332330
     
    334332{
    335333  owl_editwin *e;
    336   char buff[1024];
     334  char *buff;
    337335
    338336  /* check the arguments */
     
    350348  owl_editwin_clear(e);
    351349  owl_editwin_set_dotsend(e);
    352   strcpy(buff, "----> ");
    353   strcat(buff, line);
    354   strcat(buff, "\n");
     350  buff=owl_sprintf("----> %s\n", line);
    355351  owl_editwin_set_locktext(e, buff);
    356352
    357   /* make it active */
    358353  owl_global_set_typwin_active(&g);
    359354
    360355  owl_global_set_buffercommand(&g, line);
     356  owl_free(buff);
    361357}
    362358
Note: See TracChangeset for help on using the changeset viewer.