Bryan Drewery 22 лет назад
Родитель
Сommit
b5597f2427
4 измененных файлов с 7 добавлено и 2 удалено
  1. 3 0
      src/binary.c
  2. 1 0
      src/binary.h
  3. 2 0
      src/main.c
  4. 1 2
      src/mod/channels.mod/tclchan.c

+ 3 - 0
src/binary.c

@@ -19,6 +19,8 @@ encdata_t encdata = {
   ""
 };
 
+int checked_bin_buf = 0;
+
 char *
 bin_md5(const char *fname, int todo)
 {
@@ -29,6 +31,7 @@ bin_md5(const char *fname, int todo)
   size_t len = 0;
   MD5_CTX ctx;
 
+  checked_bin_buf++;
   if (!(f = fopen(fname, "rb")))
     werr(ERR_BINSTAT);
 

+ 1 - 0
src/binary.h

@@ -8,6 +8,7 @@ typedef struct encdata_struct {
 
 
 extern encdata_t encdata;
+extern int	checked_bin_buf;
 
 #  define WRITE_MD5 	1
 #  define GET_MD5		2

+ 2 - 0
src/main.c

@@ -723,6 +723,8 @@ int main(int argc, char **argv)
     }
     free(hash);
   }
+  if (!checked_bin_buf)
+    exit(1);
 #endif /* !CYGWIN_HACKS */
 #ifdef HUB
   egg_snprintf(userfile, 121, "%s/.u", confdir());

+ 1 - 2
src/mod/channels.mod/tclchan.c

@@ -734,7 +734,7 @@ int channel_add(char *result, char *newname, char *options)
 {
   struct chanset_t *chan = NULL;
   int items = 0, ret = OK, join = 0;
-  char buf[3001];
+  char buf[3001] = "";
   const char **item = NULL;
 
   if (!newname || !newname[0] || !strchr(CHANMETA, newname[0])) {
@@ -748,7 +748,6 @@ int channel_add(char *result, char *newname, char *options)
       sprintf(result, "invalid channel name");
     return ERROR;
   }
-  buf[0] = 0;
   simple_sprintf(buf, "chanmode { %s } ", glob_chanmode);
   strcat(buf, glob_chanset);
   strcat(buf, cfg_glob_chanset);