Changeset 7f19876
- Timestamp:
- Apr 5, 2009, 8:09:13 PM (16 years ago)
- Branches:
- owl
- Children:
- d1948ce
- Parents:
- a412918
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
ra412918 r7f19876 4 4 Fix some strcpy's that could be vulnerable 5 5 Remove an unused function 6 Fix stderr redirector, now creating admin messages 6 7 7 8 2.2.0 -
owl.c
rdb654df r7f19876 737 737 738 738 /* Sends stderr (read from rfd) messages to the error console */ 739 void stderr_redirect_handler( int handle, int rfd, int eventmask, void *data)739 void stderr_redirect_handler(owl_dispatch *d) 740 740 { 741 741 int navail, bread; 742 char *buf;743 /*owl_function_debugmsg("stderr_redirect: called with rfd=%d\n", rfd);*/742 char buf[4096]; 743 int rfd = d->fd; 744 744 if (rfd<0) return; 745 745 if (-1 == ioctl(rfd, FIONREAD, (void*)&navail)) { … … 747 747 } 748 748 /*owl_function_debugmsg("stderr_redirect: navail = %d\n", navail);*/ 749 if (navail<=0) return; 750 if (navail>256) { navail = 256; } 751 buf = owl_malloc(navail+1); 749 if (navail <= 0) return; 750 if (navail > sizeof(buf)-1) { 751 navail = sizeof(buf)-1; 752 } 752 753 bread = read(rfd, buf, navail); 753 754 if (buf[navail-1] != '\0') { 754 755 buf[navail] = '\0'; 755 756 } 756 owl_function_error("Err: %s", buf); 757 owl_free(buf); 757 owl_function_error("[stderr]\n%s", buf); 758 758 } 759 759
Note: See TracChangeset
for help on using the changeset viewer.