diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-10-15 21:02:45 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-10-15 21:02:45 +0200 |
commit | e7ce6d724c1094db17e8241c83e50c77e5b4629f (patch) | |
tree | 44daa055453b75718788c9d5de925d8f0fb04101 | |
parent | ae35eccea287974e2e157c0b5d2109463ae63db8 (diff) | |
download | libextractor-e7ce6d724c1094db17e8241c83e50c77e5b4629f.tar.gz libextractor-e7ce6d724c1094db17e8241c83e50c77e5b4629f.zip |
extra-carefully check return value of snprintf
-rw-r--r-- | src/plugins/ole2_extractor.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/ole2_extractor.c b/src/plugins/ole2_extractor.c index 20ac08f..e8e210e 100644 --- a/src/plugins/ole2_extractor.c +++ b/src/plugins/ole2_extractor.c | |||
@@ -586,13 +586,16 @@ history_extract (GsfInput *stream, | |||
586 | bsize = strlen (author) + strlen (filename) + 512; | 586 | bsize = strlen (author) + strlen (filename) + 512; |
587 | if (NULL != (rbuf = malloc (bsize))) | 587 | if (NULL != (rbuf = malloc (bsize))) |
588 | { | 588 | { |
589 | if (bsize > | 589 | int snret; |
590 | snprintf (rbuf, | 590 | |
591 | bsize, | 591 | snret = snprintf (rbuf, |
592 | _("Revision #%u: Author `%s' worked on `%s'"), | 592 | bsize, |
593 | i, | 593 | _("Revision #%u: Author `%s' worked on `%s'"), |
594 | author, | 594 | i, |
595 | filename)) | 595 | author, |
596 | filename); | ||
597 | if ( (-1 != snret) && | ||
598 | (bsize > (size_t) snret) ) | ||
596 | { | 599 | { |
597 | ret = add_metadata (proc, | 600 | ret = add_metadata (proc, |
598 | proc_cls, | 601 | proc_cls, |