From: Marius Kittler <mkittler@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1 2/2] Prevent segmentation fault when negative task count specified
Date: Tue, 12 Sep 2023 16:43:51 +0200 [thread overview]
Message-ID: <20230912144351.13494-3-mkittler@suse.de> (raw)
In-Reply-To: <20230912144351.13494-1-mkittler@suse.de>
Signed-off-by: Marius Kittler <mkittler@suse.de>
---
testcases/realtime/func/rt-migrate/rt-migrate.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/testcases/realtime/func/rt-migrate/rt-migrate.c b/testcases/realtime/func/rt-migrate/rt-migrate.c
index 2554f63e2..252e77e6a 100644
--- a/testcases/realtime/func/rt-migrate/rt-migrate.c
+++ b/testcases/realtime/func/rt-migrate/rt-migrate.c
@@ -419,6 +419,10 @@ int main(int argc, char **argv)
numcpus = sysconf(_SC_NPROCESSORS_ONLN);
nr_tasks = numcpus + 1;
}
+ if (nr_tasks < 0) {
+ printf("The number of tasks must not be negative.\n");
+ exit(EXIT_FAILURE);
+ }
intervals = malloc(sizeof(stats_container_t) * nr_tasks);
if (!intervals)
--
2.42.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-09-12 14:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-12 14:43 [LTP] [PATCH v1 0/2] Fix most severe problems with `rt-migrate.c` Marius Kittler
2023-09-12 14:43 ` [LTP] [PATCH v1 1/2] Ensure prio is within valid range in `rt-migrate.c` Marius Kittler
2023-09-13 9:11 ` Andrea Cervesato via ltp
2023-09-13 9:27 ` Marius Kittler
2023-11-13 9:31 ` Richard Palethorpe
2023-09-12 14:43 ` Marius Kittler [this message]
2023-09-13 8:54 ` [LTP] [PATCH v1 2/2] Prevent segmentation fault when negative task count specified Andrea Cervesato via ltp
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230912144351.13494-3-mkittler@suse.de \
--to=mkittler@suse.de \
--cc=ltp@lists.linux.it \
/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