Changeset f98c74e
- Timestamp:
- Apr 5, 2009, 7:36:53 PM (15 years ago)
- Branches:
- owl
- Children:
- 51b6c7c
- Parents:
- 9948234
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r9948234 rf98c74e 1 1 $Id$ 2 3 2.2.1 4 Fix some strcpy's that could be vulnerable 5 Remove an unused function 2 6 3 7 2.2.0 -
functions.c
re01449c rf98c74e 290 290 { 291 291 owl_editwin *e; 292 char buff[1024];292 char *buff; 293 293 owl_zwrite z; 294 294 int ret; … … 320 320 owl_editwin_clear(e); 321 321 owl_editwin_set_dotsend(e); 322 strcpy(buff, "----> "); 323 strcat(buff, line); 324 strcat(buff, "\n"); 322 buff=owl_sprintf("----> %s\n", line); 325 323 owl_editwin_set_locktext(e, buff); 326 324 327 /* make it active */328 325 owl_global_set_typwin_active(&g); 329 326 330 327 owl_global_set_buffercommand(&g, line); 328 owl_free(buff); 331 329 } 332 330 … … 334 332 { 335 333 owl_editwin *e; 336 char buff[1024];334 char *buff; 337 335 338 336 /* check the arguments */ … … 350 348 owl_editwin_clear(e); 351 349 owl_editwin_set_dotsend(e); 352 strcpy(buff, "----> "); 353 strcat(buff, line); 354 strcat(buff, "\n"); 350 buff=owl_sprintf("----> %s\n", line); 355 351 owl_editwin_set_locktext(e, buff); 356 352 357 /* make it active */358 353 owl_global_set_typwin_active(&g); 359 354 360 355 owl_global_set_buffercommand(&g, line); 356 owl_free(buff); 361 357 } 362 358 -
message.c
rfa00c5c rf98c74e 590 590 int owl_message_is_burningears(owl_message *m) 591 591 { 592 /* we should add a global to cache the short zsender */593 char sender[LINE], *ptr;592 char *name; 593 int ret; 594 594 595 595 /* if the message is from us or to us, it doesn't count */ … … 597 597 598 598 if (owl_message_is_type_zephyr(m)) { 599 strcpy(sender, owl_zephyr_get_sender()); 600 ptr=strchr(sender, '@'); 601 if (ptr) *ptr='\0'; 599 name=short_zuser(owl_zephyr_get_sender()); 602 600 } else if (owl_message_is_type_aim(m)) { 603 strcpy(sender,owl_global_get_aim_screenname(&g));601 name=owl_strdup(owl_global_get_aim_screenname(&g)); 604 602 } else { 605 603 return(0); 606 604 } 607 605 608 if (stristr(owl_message_get_body(m), sender)) { 609 return(1); 610 } 611 return(0); 606 if (stristr(owl_message_get_body(m), name)) { 607 ret=1; 608 } else { 609 ret=0; 610 } 611 612 owl_free(name); 613 return(ret); 612 614 } 613 615 -
owl.h
r6fdef66 rf98c74e 46 46 static const char owl_h_fileIdent[] = "$Id$"; 47 47 48 #define OWL_VERSION 2.2. 049 #define OWL_VERSION_STRING "2.2. 0"48 #define OWL_VERSION 2.2.1 49 #define OWL_VERSION_STRING "2.2.1-pre-1" 50 50 51 51 /* Feature that is being tested to redirect stderr through a pipe. -
perlconfig.c
rfa00c5c rf98c74e 179 179 int ret, fd; 180 180 PerlInterpreter *p; 181 char filename[ 1024];181 char filename[MAXPATHLEN]; 182 182 char *embedding[5]; 183 183 char *err; -
stylefunc.c
rfa00c5c rf98c74e 34 34 { 35 35 #ifdef HAVE_LIBZEPHYR 36 char *body, *indent, *ptr, *zsigbuff, frombuff[LINE];36 char *body, *indent, *ptr, *zsigbuff, *frombuff; 37 37 ZNotice_t *n; 38 38 #endif … … 56 56 57 57 /* edit the from addr for printing */ 58 strcpy(frombuff, owl_message_get_sender(m)); 59 ptr=strchr(frombuff, '@'); 60 if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) { 61 *ptr='\0'; 62 } 58 frombuff=short_zuser(owl_message_get_sender(m)); 63 59 64 60 /* set the message for printing */ … … 131 127 owl_free(body); 132 128 owl_free(indent); 129 owl_free(frombuff); 133 130 #endif 134 131 } else if (owl_message_is_type_zephyr(m) && owl_message_is_direction_out(m)) { … … 243 240 char *shorttimestr; 244 241 #ifdef HAVE_LIBZEPHYR 245 char *body, *indent, *ptr, *zsigbuff, frombuff[LINE];242 char *body, *indent, *ptr, *zsigbuff, *frombuff; 246 243 ZNotice_t *n; 247 244 #endif … … 267 264 268 265 /* edit the from addr for printing */ 269 strcpy(frombuff, owl_message_get_sender(m)); 270 ptr=strchr(frombuff, '@'); 271 if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) { 272 *ptr='\0'; 273 } 266 frombuff=short_zuser(owl_message_get_sender(m)); 274 267 275 268 /* set the message for printing */ … … 348 341 owl_free(body); 349 342 owl_free(indent); 343 owl_free(frombuff); 350 344 #endif 351 345 } else if (owl_message_is_type_zephyr(m) && owl_message_is_direction_out(m)) { … … 604 598 { 605 599 #ifdef HAVE_LIBZEPHYR 606 char *body, *indent, *ptr, frombuff[LINE];600 char *body, *indent, *ptr, *frombuff; 607 601 owl_fmtext fm_first, fm_other, fm_tmp; 608 602 ZNotice_t *n; … … 640 634 641 635 /* edit the from addr for printing */ 642 strcpy(frombuff, owl_message_get_sender(m)); 643 ptr=strchr(frombuff, '@'); 644 if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) { 645 *ptr='\0'; 646 } 636 frombuff=short_zuser(owl_message_get_sender(m)); 647 637 sender=owl_sprintf("%-9.9s", frombuff); 648 638 … … 707 697 708 698 owl_free(sender); 699 owl_free(frombuff); 709 700 owl_free(hostname); 710 701 owl_free(timestr); -
text.c
rfa00c5c rf98c74e 351 351 tolen = strlen(to); 352 352 fromlen = strlen(from); 353 out = malloc(outlen);353 out = owl_malloc(outlen); 354 354 355 355 while (in[inpos]) { -
zephyr.c
rf19fef4 rf98c74e 100 100 FILE *file; 101 101 char *tmp, *start; 102 char buffer[1024], subsfile[ 1024];102 char buffer[1024], subsfile[MAXPATHLEN]; 103 103 ZSubscription_t subs[3001]; 104 104 int count, ret; … … 188 188 FILE *file; 189 189 ZSubscription_t subs[3001]; 190 char subsfile[ 1024], buffer[1024];190 char subsfile[MAXPATHLEN], buffer[1024]; 191 191 int count, ret, i; 192 192 struct stat statbuff; … … 674 674 { 675 675 #ifdef HAVE_LIBZEPHYR 676 char *line, subsfile[ LINE], buff[LINE];676 char *line, subsfile[MAXPATHLEN], buff[LINE]; 677 677 FILE *file; 678 678 -
zwrite.c
rfa00c5c rf98c74e 352 352 } 353 353 354 void owl_zwrite_get_recipstr(owl_zwrite *z, char *buff)355 {356 int i, j;357 358 strcpy(buff, "");359 j=owl_list_get_size(&(z->recips));360 for (i=0; i<j; i++) {361 strcat(buff, owl_list_get_element(&(z->recips), i));362 strcat(buff, " ");363 }364 buff[strlen(buff)-1]='\0';365 }366 367 354 int owl_zwrite_get_numrecips(owl_zwrite *z) 368 355 {
Note: See TracChangeset
for help on using the changeset viewer.