summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2014-03-25 15:53:47 -0500
committerepoch <epoch@hacking.allowed.org>2014-03-25 15:53:47 -0500
commit7bfe791fa77d7b9adf430bd24266d9837230cade (patch)
treee2c7379347538543ee74ef9154f89c2c316142a5
parentfe808525acbc71410e22bbb6b5cfa5266b2dd30f (diff)
downloadsegfault-7bfe791fa77d7b9adf430bd24266d9837230cade.tar.gz
segfault-7bfe791fa77d7b9adf430bd24266d9837230cade.zip
fixed it *really*
-rwxr-xr-xdebug/tcpdump3
-rw-r--r--libirc/libirc.c8
-rwxr-xr-xlibirc/libirc.sobin7585 -> 7561 bytes
-rw-r--r--segfault.c5
4 files changed, 14 insertions, 2 deletions
diff --git a/debug/tcpdump b/debug/tcpdump
new file mode 100755
index 0000000..6a8aa9f
--- /dev/null
+++ b/debug/tcpdump
@@ -0,0 +1,3 @@
+#!/bin/bash
+PORT=$(sockstat -n | grep segfault | tr -s ' ' | cut -d. -f5 | cut '-d ' -f1)
+tcpdump -q -s0 -nXXi lo0 port $PORT
diff --git a/libirc/libirc.c b/libirc/libirc.c
index c529d10..ee4506d 100644
--- a/libirc/libirc.c
+++ b/libirc/libirc.c
@@ -100,8 +100,12 @@ int runit(int fd,void (*line_handler)(),void (*extra_handler)()) {
line[i-s+1]=0;//gotta null terminate this. line_handler expects it.
s=i+1;//the character after the newline.
if(!strncmp(line,"PING",4)) {
- fprintf(fp,"PONG %s\r\n",line+6);//a whole FILE * and fdopen JUST for this??? oy...
- fflush(fp);
+ t=malloc(strlen(line));
+ strcpy(t,"PONG ");
+ strcat(t,line+6);
+ write(fd,t,strlen(t));
+ //fprintf(fp,"PONG %s",line+6);//a whole FILE * and fdopen JUST for this??? oy...
+ //fflush(fp);
#ifdef DEBUG
printf("%s\nPONG %s\n",line,line+6);
write(fd,"PRIVMSG %s :PONG! w00t!\r\n",DEBUG,28);
diff --git a/libirc/libirc.so b/libirc/libirc.so
index c333bd8..222613c 100755
--- a/libirc/libirc.so
+++ b/libirc/libirc.so
Binary files differ
diff --git a/segfault.c b/segfault.c
index 9fb6df5..938c385 100644
--- a/segfault.c
+++ b/segfault.c
@@ -705,10 +705,12 @@ void c_leetappend(int fd,char *from,char *msg) {
void c_tails(int fd,char *from) {
int i;
int l;
+ int at_least_one=0;
char *tmp,*x;
//privmsg(fd,from,"filename@filepos --msg|raw-> IRCdestination");
for(i=0;i<MAXTAILS;i++) {
if(tailf[i].fp) {
+ at_least_one=1;
l=(strlen(tailf[i].file) + strlen(tailf[i].to) + 50);//??? hack. fix it.
tmp=malloc(l);
if(!tmp) {
@@ -722,6 +724,9 @@ void c_tails(int fd,char *from) {
free(tmp);
}
}
+ if(!at_least_one) {
+ privmsg(fd,from,"I don't have any tails. :(");
+ }
}
char recording,recording_raw;