Fix argument checks in gzlog_compress() and gzlog_write().
This commit is contained in:
parent
aef4174dd2
commit
fb4e0599a5
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* gzlog.c
|
* gzlog.c
|
||||||
* Copyright (C) 2004, 2008 Mark Adler, all rights reserved
|
* Copyright (C) 2004, 2008, 2012 Mark Adler, all rights reserved
|
||||||
* For conditions of distribution and use, see copyright notice in gzlog.h
|
* For conditions of distribution and use, see copyright notice in gzlog.h
|
||||||
* version 2.0, 25 Apr 2008
|
* version 2.1, 8 Jul 2012
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -913,7 +913,7 @@ int gzlog_compress(gzlog *logd)
|
|||||||
struct log *log = logd;
|
struct log *log = logd;
|
||||||
|
|
||||||
/* check arguments */
|
/* check arguments */
|
||||||
if (log == NULL || strcmp(log->id, LOGID) || len < 0)
|
if (log == NULL || strcmp(log->id, LOGID))
|
||||||
return -3;
|
return -3;
|
||||||
|
|
||||||
/* see if we lost the lock -- if so get it again and reload the extra
|
/* see if we lost the lock -- if so get it again and reload the extra
|
||||||
@ -997,9 +997,9 @@ int gzlog_write(gzlog *logd, void *data, size_t len)
|
|||||||
struct log *log = logd;
|
struct log *log = logd;
|
||||||
|
|
||||||
/* check arguments */
|
/* check arguments */
|
||||||
if (log == NULL || strcmp(log->id, LOGID) || len < 0)
|
if (log == NULL || strcmp(log->id, LOGID))
|
||||||
return -3;
|
return -3;
|
||||||
if (data == NULL || len == 0)
|
if (data == NULL || len <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* see if we lost the lock -- if so get it again and reload the extra
|
/* see if we lost the lock -- if so get it again and reload the extra
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* gzlog.h
|
/* gzlog.h
|
||||||
Copyright (C) 2004, 2008 Mark Adler, all rights reserved
|
Copyright (C) 2004, 2008, 2012 Mark Adler, all rights reserved
|
||||||
version 2.0, 25 Apr 2008
|
version 2.1, 8 Jul 2012
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the author be held liable for any damages
|
warranty. In no event will the author be held liable for any damages
|
||||||
@ -27,6 +27,7 @@
|
|||||||
Interface changed slightly in that now path is a prefix
|
Interface changed slightly in that now path is a prefix
|
||||||
Compression now occurs as needed during gzlog_write()
|
Compression now occurs as needed during gzlog_write()
|
||||||
gzlog_write() now always leaves the log file as valid gzip
|
gzlog_write() now always leaves the log file as valid gzip
|
||||||
|
2.1 8 Jul 2012 Fix argument checks in gzlog_compress() and gzlog_write()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user