]> git.pld-linux.org Git - packages/squidGuard.git/blob - squidGuard-long-urls-buffer-overflow.patch
- release 4 (by relup.sh)
[packages/squidGuard.git] / squidGuard-long-urls-buffer-overflow.patch
1 based on http://www.squidguard.org/Downloads/Patches/1.4/squidGuard-1.4-patch-20091015.tar.gz
2
3 --- a/src/sgLog.c       2007-11-16 17:58:32.000000000 +0100
4 +++ b/src/sgLog.c       2009-10-15 21:25:14.000000000 +0200
5 @@ -2,7 +2,7 @@
6    By accepting this notice, you agree to be bound by the following
7    agreements:
8    
9 -  This software product, squidGuard, is copyrighted (C) 1998-2007
10 +  This software product, squidGuard, is copyrighted (C) 1998-2009
11    by Christine Kronberg, Shalla Secure Services. All rights reserved.
12   
13    This program is free software; you can redistribute it and/or modify it
14 @@ -55,8 +55,8 @@
15    char msg[MAX_BUF];
16    va_list ap;
17    VA_START(ap, format);
18 -  if(vsprintf(msg, format, ap) > (MAX_BUF - 1)) 
19 -    fprintf(stderr,"overflow in vsprintf (sgLog): %s",strerror(errno));
20 +  if(vsnprintf(msg, MAX_BUF, format, ap) > (MAX_BUF - 1)) 
21 +    fprintf(stderr,"overflow in vsnprintf (sgLog): %s",strerror(errno));
22    va_end(ap);
23    date = niso(0);
24    if(globalDebug || log == NULL) {
25 @@ -87,8 +87,8 @@
26    char msg[MAX_BUF];
27    va_list ap;
28    VA_START(ap, format);
29 -  if(vsprintf(msg, format, ap) > (MAX_BUF - 1)) 
30 -    sgLogFatalError("overflow in vsprintf (sgLogError): %s",strerror(errno));
31 +  if(vsnprintf(msg, MAX_BUF, format, ap) > (MAX_BUF - 1)) 
32 +    sgLog(globalErrorLog, "overflow in vsnprintf (sgLogError): %s",strerror(errno));
33    va_end(ap);
34    sgLog(globalErrorLog,"%s",msg);
35  }
36 @@ -104,8 +104,8 @@
37    char msg[MAX_BUF];
38    va_list ap;
39    VA_START(ap, format);
40 -  if(vsprintf(msg, format, ap) > (MAX_BUF - 1)) 
41 -    return;
42 +  if(vsnprintf(msg, MAX_BUF, format, ap) > (MAX_BUF - 1)) 
43 +    sgLog(globalErrorLog, "overflow in vsnprintf (sgLogError): %s",strerror(errno));
44    va_end(ap);
45    sgLog(globalErrorLog,"%s",msg);
46    sgEmergency();
This page took 0.049767 seconds and 3 git commands to generate.