gnunet-svn
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]