From: Paul Eggert <eggert@cs.ucla.edu>
To: bug-gnulib@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH] maint: pacify GCC 11.2 -fanalyzer in crypto tests
Date: Sat, 31 Jul 2021 12:59:37 -0700 [thread overview]
Message-ID: <20210731195937.280515-1-eggert@cs.ucla.edu> (raw)
* tests/bench-digest.h (main): Report an error after memory
exhaustion, instead of using a null pointer.
---
ChangeLog | 6 ++++++
tests/bench-digest.h | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index e35192a9e..80bcabd22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-07-31 Paul Eggert <eggert@cs.ucla.edu>
+
+ maint: pacify GCC 11.2 -fanalyzer in crypto tests
+ * tests/bench-digest.h (main): Report an error after memory
+ exhaustion, instead of using a null pointer.
+
2021-07-30 Paul Eggert <eggert@cs.ucla.edu>
xalloc: add malloc-related function attributes
diff --git a/tests/bench-digest.h b/tests/bench-digest.h
index 96a449924..3ded94119 100644
--- a/tests/bench-digest.h
+++ b/tests/bench-digest.h
@@ -82,6 +82,11 @@ main (int argc, char *argv[])
int repeat = atoi (argv[2]);
char *memblock = (char *) malloc (size);
+ if (!memblock)
+ {
+ fprintf (stderr, "%s: memory exhausted\n", argv[0]);
+ return 1;
+ }
/* Fill the memory block. */
{
--
2.31.1
reply other threads:[~2021-07-31 19:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210731195937.280515-1-eggert@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).