]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - splitlog.c
Protection against buffer overflows in getword and friends and report the origin...
[thirdparty/sarg.git] / splitlog.c
index 6dbb5e3613474780c59889413a9b38f113e8ce1e..42a676fe553c4b180de232a97ff0b3eaba51798d 100644 (file)
@@ -47,7 +47,10 @@ void splitlog(char *arq, char *df, int dfrom, int duntil, char *convert)
    }
 
    while(fgets(buf,sizeof(buf),fp_in)!=NULL) {
-      getword(data,buf,' ');
+      if (getword(data,sizeof(data),buf,' ')<0) {
+         printf("SARG: Maybe you have a broken record or garbage in your %s file.\n",arq);
+         exit(1);
+      }
       tt=atoi(data);
       t=localtime(&tt);