[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libextractor] 11/27: be more conservative about result fro
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libextractor] 11/27: be more conservative about result from ctime_r |
Date: |
Sun, 15 Oct 2017 21:34:35 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libextractor.
commit bb8184768d6b13bd32a3eb2224110f3e00573cbc
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Oct 15 20:17:32 2017 +0200
be more conservative about result from ctime_r
---
src/plugins/rpm_extractor.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/plugins/rpm_extractor.c b/src/plugins/rpm_extractor.c
index d54e3417..e1f2d621 100644
--- a/src/plugins/rpm_extractor.c
+++ b/src/plugins/rpm_extractor.c
@@ -352,8 +352,11 @@ EXTRACTOR_rpm_extract_method (struct
EXTRACTOR_ExtractContext *ec)
uint32_t *v = rpmtdNextUint32 (p);
time_t tp = (time_t) *v;
- ctime_r (&tp, tmp);
- tmp[strlen (tmp) - 1] = '\0'; /* eat linefeed */
+ if (NULL == ctime_r (&tp, tmp))
+ break;
+ if ( (strlen (tmp) > 0) &&
+ (isblank ((unsigned char) tmp[strlen(tmp)-1])) )
+ tmp[strlen (tmp) - 1] = '\0'; /* eat linefeed */
pthread_mutex_lock (&parg.lock);
if (0 != ec->proc (ec->cls,
"rpm",
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libextractor] branch master updated (d0a7ceb6 -> e340cef5), gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 01/27: indentation fixes, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 04/27: indentation fixes, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 02/27: fix potential assign-after-free, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 08/27: fix potential buffer underflow read in deb_extractor, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 05/27: defensive programming: avoid malloc(0) in deb extractor, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 03/27: avoid passing of char to isspace()-family of functions, always pass unsigned chars, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 09/27: fix very hypothetical lack of 0-termination in ole2-extractor iff translation string was more than 10x as long as the English version, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 16/27: handle allocation failure in gstreamer plugin, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 11/27: be more conservative about result from ctime_r,
gnunet <=
- [GNUnet-SVN] [libextractor] 14/27: add missing continue if max meta data was reached to avoid use after free, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 15/27: fix indentation, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 06/27: fix duration initialization in ffmpeg extractor (badly positioned #if), gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 13/27: seems some specs of c_time allow up to 71 bytes, so increase buffer size just to be safe, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 19/27: need isspace, not isblank for rpm extractor, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 17/27: handle allocation failure in PDF fdopen call, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 18/27: do not try to seek on SHM if we do not use SHM, even if (bad) plugin requests it, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 10/27: be more careful with memory allocation failures in gsf extractor, avoid calling g_free(NULL), gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 20/27: fix signed/unsigned comparison issue, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 21/27: handle IPC_shared_memory_set_ error, gnunet, 2017/10/15