[PD-cvs] pd/src s_inter.c,1.1.1.3.2.9.2.4,1.1.1.3.2.9.2.5
Mathieu Bouchard
matju at users.sourceforge.net
Wed Apr 7 08:44:52 CEST 2004
- Previous message: [PD-cvs] pd/src g_all_guis.h,1.1.1.4.2.2.2.8,1.1.1.4.2.2.2.9
- Next message: [PD-cvs] externals/build/src attract1.c,1.1,1.2 base.c,1.1,1.2 base3.c,1.1,1.2 dejong.c,1.1,1.2 gingerbreadman.c,1.1,1.2 henon.c,1.4,1.5 hopalong.c,1.1,1.2 ikeda.c,1.4,1.5 latoocarfian.c,1.1,1.2 latoomutalpha.c,1.1,1.2 latoomutbeta.c,1.1,1.2 latoomutgamma.c,1.1,1.2 logistic.c,1.1,1.2 lorenz.c,1.4,1.5 lotka_volterra.c,1.1,1.2 martin.c,1.1,1.2 mlogistic.c,1.1,1.2 pickover.c,1.1,1.2 popcorn.c,1.1,1.2 popup.c,1.1,1.2 quadruptwo.c,1.1,1.2 rossler.c,1.4,1.5 standardmap.c,1.1,1.2 strange1.c,1.1,1.2 tent.c,1.1,1.2 three_d.c,1.1,1.2 threeply.c,1.1,1.2 tinkerbell.c,1.1,1.2 unity.c,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16681
Modified Files:
Tag: impd_0_37
s_inter.c
Log Message:
being verbose on sys_gui() buffer overflows
Index: s_inter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v
retrieving revision 1.1.1.3.2.9.2.4
retrieving revision 1.1.1.3.2.9.2.5
diff -C2 -d -r1.1.1.3.2.9.2.4 -r1.1.1.3.2.9.2.5
*** s_inter.c 2 Apr 2004 05:03:27 -0000 1.1.1.3.2.9.2.4
--- s_inter.c 7 Apr 2004 06:44:50 -0000 1.1.1.3.2.9.2.5
***************
*** 325,329 ****
else /* TCP ("streaming") socket protocol */
{
- char *semi;
int readto =
(x->sr_inhead >= x->sr_intail ? INBUFSIZE : x->sr_intail-1);
--- 325,328 ----
***************
*** 416,424 ****
while (1)
{
! //res = send(sys_guisock, s + written, length, 0);
! //fcntl(sys_guisock,F_SETFL,fcntl(sys_guisock,F_GETFL)| O_NONBLOCK);
res = send(sys_guisock, s + written, length, 0);
! //fcntl(sys_guisock,F_SETFL,fcntl(sys_guisock,F_GETFL)&~O_NONBLOCK);
if (res<0 && errno==EAGAIN) res=0;
--- 415,423 ----
while (1)
{
! /*res = send(sys_guisock, s + written, length, 0);*/
! /*fcntl(sys_guisock,F_SETFL,fcntl(sys_guisock,F_GETFL)| O_NONBLOCK);*/
res = send(sys_guisock, s + written, length, 0);
! /*fcntl(sys_guisock,F_SETFL,fcntl(sys_guisock,F_GETFL)&~O_NONBLOCK);*/
if (res<0 && errno==EAGAIN) res=0;
***************
*** 443,447 ****
void sys_vgui(char *fmt, ...)
{
- int result;
unsigned n;
char buf[2048];
--- 442,445 ----
***************
*** 450,454 ****
n = vsnprintf(buf, sizeof(buf), fmt, ap);
if (n>=sizeof(buf)) {
! fprintf(stderr,"sys_vgui: buffer overflow\n");
abort();
}
--- 448,453 ----
n = vsnprintf(buf, sizeof(buf), fmt, ap);
if (n>=sizeof(buf)) {
! fprintf(stderr,"sys_vgui: buffer overflow (%d in %d)\n",n,sizeof(buf));
! fprintf(stderr," starts like: %.64s [...]\n",buf);
abort();
}
***************
*** 481,494 ****
{
static int trouble = 0;
! if (!trouble)
! {
! trouble = 1;
! fprintf(stderr, "Pd: signal %d\n", n);
! sys_bail(1);
}
! else _exit(1);
}
static void sys_alarmhandler(int n)
{
--- 480,510 ----
{
static int trouble = 0;
! if (trouble) _exit(1);
! trouble = 1;
! fprintf(stderr, "Pd: signal %d\n", n);
! sys_bail(1);
! }
+ static void sys_apocalypse(int n)
+ {
+ static int trouble = 0;
+ if (trouble) _exit(1);
+ trouble = 1;
+ fprintf(stderr, "Pd: signal %d\n", n);
+ /* isn't really useful, because it sees only
+ the signal stack, not the app's stack
+ #ifdef UNIX
+ {
+ pid_t pid = getpid();
+ char foo[256];
+ sprintf(foo,"rxvt -e gdb --pid=%d `which pd`",pid);
+ system(foo);
}
! #endif
! */
! sys_bail(1);
}
+
static void sys_alarmhandler(int n)
{
***************
*** 571,576 ****
char cmdbuf[4*MAXPDSTRING];
struct sockaddr_in server;
- int msgsock;
- char buf[15];
int len = sizeof(server);
int ntry = 0, portno = FIRSTPORTNUM;
--- 587,590 ----
***************
*** 595,601 ****
signal(SIGIOT, sys_exithandler);
signal(SIGFPE, SIG_IGN);
! /* signal(SIGILL, sys_exithandler);
! signal(SIGBUS, sys_exithandler);
! signal(SIGSEGV, sys_exithandler); */
signal(SIGPIPE, sys_exithandler);
signal(SIGALRM, SIG_IGN);
--- 609,615 ----
signal(SIGIOT, sys_exithandler);
signal(SIGFPE, SIG_IGN);
! signal(SIGILL, sys_apocalypse);
! signal(SIGBUS, sys_apocalypse);
! signal(SIGSEGV, sys_apocalypse);
signal(SIGPIPE, sys_exithandler);
signal(SIGALRM, SIG_IGN);
- Previous message: [PD-cvs] pd/src g_all_guis.h,1.1.1.4.2.2.2.8,1.1.1.4.2.2.2.9
- Next message: [PD-cvs] externals/build/src attract1.c,1.1,1.2 base.c,1.1,1.2 base3.c,1.1,1.2 dejong.c,1.1,1.2 gingerbreadman.c,1.1,1.2 henon.c,1.4,1.5 hopalong.c,1.1,1.2 ikeda.c,1.4,1.5 latoocarfian.c,1.1,1.2 latoomutalpha.c,1.1,1.2 latoomutbeta.c,1.1,1.2 latoomutgamma.c,1.1,1.2 logistic.c,1.1,1.2 lorenz.c,1.4,1.5 lotka_volterra.c,1.1,1.2 martin.c,1.1,1.2 mlogistic.c,1.1,1.2 pickover.c,1.1,1.2 popcorn.c,1.1,1.2 popup.c,1.1,1.2 quadruptwo.c,1.1,1.2 rossler.c,1.4,1.5 standardmap.c,1.1,1.2 strange1.c,1.1,1.2 tent.c,1.1,1.2 three_d.c,1.1,1.2 threeply.c,1.1,1.2 tinkerbell.c,1.1,1.2 unity.c,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Pd-cvs
mailing list