[hackers] [ii] fixed possible NULL pointer reference on sparc

From: Nico Golde <nion_AT_suckless.org>
Date: Mon Jul 16 08:01:16 2007

changeset: 76:e48edb885e6e
tag: tip
user: Nico Golde <nion_AT_suckless.org>
date: Mon Jul 16 08:00:48 2007 +0200
summary: fixed possible NULL pointer reference on sparc

diff -r d12fd0a7246a -r e48edb885e6e ii.c
--- a/ii.c Sat Jul 14 21:23:41 2007 +0200
+++ b/ii.c Mon Jul 16 08:00:48 2007 +0200
@@ -206,7 +206,7 @@ static void print_out(char *channel, cha
         static char buft[18];
         time_t t = time(0);
 
- snprintf(server, sizeof(server), "-!- %s", channel);
+ if(channel) snprintf(server, sizeof(server), "-!- %s", channel);
         if(strstr(buf, server)) channel="";
         create_filepath(outfile, sizeof(outfile), channel, "out");
         if(!(out = fopen(outfile, "a"))) return;
Received on Mon Jul 16 2007 - 08:01:16 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:37 UTC