[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libextractor] 23/27: extra-carefully check return value of
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libextractor] 23/27: extra-carefully check return value of snprintf |
Date: |
Sun, 15 Oct 2017 21:34:47 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libextractor.
commit e7ce6d724c1094db17e8241c83e50c77e5b4629f
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Oct 15 21:02:45 2017 +0200
extra-carefully check return value of snprintf
---
src/plugins/ole2_extractor.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/plugins/ole2_extractor.c b/src/plugins/ole2_extractor.c
index 20ac08f6..e8e210eb 100644
--- a/src/plugins/ole2_extractor.c
+++ b/src/plugins/ole2_extractor.c
@@ -586,13 +586,16 @@ history_extract (GsfInput *stream,
bsize = strlen (author) + strlen (filename) + 512;
if (NULL != (rbuf = malloc (bsize)))
{
- if (bsize >
- snprintf (rbuf,
- bsize,
- _("Revision #%u: Author `%s' worked on `%s'"),
- i,
- author,
- filename))
+ int snret;
+
+ snret = snprintf (rbuf,
+ bsize,
+ _("Revision #%u: Author `%s' worked on `%s'"),
+ i,
+ author,
+ filename);
+ if ( (-1 != snret) &&
+ (bsize > (size_t) snret) )
{
ret = add_metadata (proc,
proc_cls,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libextractor] 10/27: be more careful with memory allocation failures in gsf extractor, avoid calling g_free(NULL), (continued)
- [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
- [GNUnet-SVN] [libextractor] 25/27: avoid NPE on empty value in grep-friendly printing, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 12/27: fix NPE in extract for 0-byte values, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 07/27: doxygen improvements, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 26/27: check return values from dup2(), gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 22/27: remove useless assignment, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 24/27: avoid calling free(NULL) on plugin load error, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 27/27: update gitignore, gnunet, 2017/10/15
- [GNUnet-SVN] [libextractor] 23/27: extra-carefully check return value of snprintf,
gnunet <=