View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0007653 | GNUnet | core service | public | 2023-01-30 00:50 | 2023-06-01 20:26 |
Reporter | ulfvonbelow | Assigned To | schanzen | ||
Priority | normal | Severity | trivial | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | Git master | ||||
Target Version | 0.19.4 | Fixed in Version | 0.19.4 | ||
Summary | 0007653: Memory leak in test_core_quota_compliance | ||||
Description | in process_hello, p->hello is overwritten without checking whether it needs to be freed first. | ||||
Steps To Reproduce | ./configure --enable-sanitizer make make install make check | ||||
Additional Information | Patch attached. With this final patch, the test suite fully passes (aside from a few nondeterministic failures if you've got a busy, slow hard drive like me) with sanitizers fully enabled. Meaning we can keep them enabled for future test runs \o/. | ||||
Tags | patch | ||||
|
0001-CORE-fix-memory-leak-in-test.patch (934 bytes)
From 2addaf87037b6ec138d64abf71e17719a3a131a2 Mon Sep 17 00:00:00 2001 From: ulfvonbelow <strilen@tilde.club> Date: Sun, 29 Jan 2023 07:10:47 -0600 Subject: [PATCH] -CORE: fix memory leak in test. This allows us to use sanitizers to find bugs that matter. --- src/core/test_core_quota_compliance.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index eb5ca7c2b..099c6fa3b 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -530,6 +530,7 @@ process_hello (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received (my) HELLO from transport service\n"); GNUNET_assert (message != NULL); + if (NULL != p->hello) GNUNET_free (p->hello); p->hello = GNUNET_malloc (ntohs (message->size)); GNUNET_memcpy (p->hello, message, ntohs (message->size)); if ((p == &p1) && -- 2.38.1 |
|
Thank you very much. Please send a mail if you want to continue hacking and need commit rights to either the mailing list or privately. |
|
released some time ago |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-01-30 00:50 | ulfvonbelow | New Issue | |
2023-01-30 00:50 | ulfvonbelow | Tag Attached: patch | |
2023-01-30 00:50 | ulfvonbelow | File Added: 0001-CORE-fix-memory-leak-in-test.patch | |
2023-02-06 05:52 | schanzen | Assigned To | => schanzen |
2023-02-06 05:52 | schanzen | Status | new => resolved |
2023-02-06 05:52 | schanzen | Resolution | open => fixed |
2023-02-06 05:52 | schanzen | Fixed in Version | => 0.19.4 |
2023-02-06 05:52 | schanzen | Note Added: 0019762 | |
2023-02-06 06:19 | schanzen | Target Version | => 0.19.4 |
2023-06-01 20:26 | schanzen | Note Added: 0020217 | |
2023-06-01 20:26 | schanzen | Status | resolved => closed |