Changeset af2ca19


Ignore:
Timestamp:
Sep 16, 2002, 6:13:41 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
62f24bc
Parents:
42abb10
Message:
Fixed memory leak and buffer overrun in fmtext
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r42abb10 raf2ca19  
    55        There is now a 'zlist' command that acts like 'znol -l'
    66        'l' is bound to 'zlist'
     7        Fixed memory leak and buffer overrun in fmtext
    78       
    891.2.3
  • fmtext.c

    r4b464a4 raf2ca19  
    396396  char *ptr1, *ptr2;
    397397  int i, offset;
    398 
    399   /* initialize out */
    400   owl_fmtext_init_null(out);
    401398 
    402399  /* find the starting line */
     
    436433  /* the message is expected to end in a new line for now */
    437434
    438   owl_fmtext_init_null(out);
    439 
    440435  last=in->textbuff+in->textlen-1;
    441436  ptr1=in->textbuff;
     
    478473  int lines, i;
    479474
     475  if (f->textlen==0) return(0);
     476 
    480477  lines=0;
    481   for (i=0; f->textbuff[i]!='\0'; i++) {
     478  for (i=0; i<f->textlen; i++) {
    482479    if (f->textbuff[i]=='\n') lines++;
    483480  }
  • message.c

    r4b464a4 raf2ca19  
    205205  owl_fmtext a, b;
    206206
     207  owl_fmtext_init_null(&a);
     208  owl_fmtext_init_null(&b);
     209 
    207210  owl_fmtext_truncate_lines(&(m->fmtext), aline, bline-aline+1, &a);
    208211  owl_fmtext_truncate_cols(&a, acol, bcol, &b);
  • viewwin.c

    r1aee7d9 raf2ca19  
    5555  wmove(v->curswin, 0, 0);
    5656
     57  owl_fmtext_init_null(&fm1);
     58  owl_fmtext_init_null(&fm2);
     59 
    5760  owl_fmtext_truncate_lines(&(v->fmtext), v->topline, v->winlines-BOTTOM_OFFSET, &fm1);
    5861  owl_fmtext_truncate_cols(&fm1, v->rightshift, v->wincols-1+v->rightshift, &fm2);
     
    7477    doupdate();
    7578  }
     79
     80  owl_fmtext_free(&fm1);
     81  owl_fmtext_free(&fm2);
    7682}
    7783
Note: See TracChangeset for help on using the changeset viewer.