summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-05-18 00:54:47 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-05-18 00:54:47 -0500
commit58b36e35a16284c02bf3fe699056806f0981ae93 (patch)
treee9dcc296173ea1f603cf6d9584f922bd3a9302ca
parent1432454e2c60cd12e35739e217dfb1c3ead19a41 (diff)
downloadsegfault-58b36e35a16284c02bf3fe699056806f0981ae93.tar.gz
segfault-58b36e35a16284c02bf3fe699056806f0981ae93.zip
fixed a crash in !builtins and !aliases due to... something.
-rw-r--r--segfault.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/segfault.c b/segfault.c
index 535b0ba..ad57a21 100644
--- a/segfault.c
+++ b/segfault.c
@@ -560,6 +560,7 @@ void c_builtin(int fd,char *from,char *line,...) {
void c_builtins(int fd,char *from,char *line,...) {
char tmp[512];
+ struct hitem *hi;
struct entry *m;
int i,j=0,k=0;
if(!line){
@@ -571,13 +572,18 @@ void c_builtins(int fd,char *from,char *line,...) {
snprintf(tmp,sizeof(tmp)-1,"builtins in bucket: %d",builtin.keys[i]);
privmsg(fd,from,tmp);
}
- for(m=builtin.bucket[builtin.keys[i]]->ll;m;m=m->next) {
- if(strcasestr(m->original,line) || *line=='*') {
- snprintf(tmp,sizeof(tmp)-1," %s -> %p",m->original,m->target);
- privmsg(fd,from,tmp);
- j++;
+ hi=builtin.bucket[builtin.keys[i]];
+ if(hi) {
+ for(m=builtin.bucket[builtin.keys[i]]->ll;m;m=m->next) {
+ if(strcasestr(m->original,line) || *line=='*') {
+ snprintf(tmp,sizeof(tmp)-1," %s -> %p",m->original,m->target);
+ privmsg(fd,from,tmp);
+ j++;
+ }
+ k++;
}
- k++;
+ } else {
+ privmsg(fd,from,"what the fuck? this bucket isn't set!");
}
}
snprintf(tmp,sizeof(tmp)-1,"found %d of %d in builtins",j,k);