summaryrefslogtreecommitdiff
path: root/debian/patches/0004-libports-avoid-realloc-3-corner-case.patch
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-06-16 18:26:51 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-06-16 18:26:51 +0200
commitb76acd29316bb5ddd52f4daef03866532174f298 (patch)
tree93163c7aeae196a37564ec1743918b6f841d657d /debian/patches/0004-libports-avoid-realloc-3-corner-case.patch
parent3b1b5338e43a6bf36881ab9f6b1ae176d7e47d7c (diff)
drop old patch series
Diffstat (limited to 'debian/patches/0004-libports-avoid-realloc-3-corner-case.patch')
-rw-r--r--debian/patches/0004-libports-avoid-realloc-3-corner-case.patch34
1 files changed, 0 insertions, 34 deletions
diff --git a/debian/patches/0004-libports-avoid-realloc-3-corner-case.patch b/debian/patches/0004-libports-avoid-realloc-3-corner-case.patch
deleted file mode 100644
index 7af7f42b..00000000
--- a/debian/patches/0004-libports-avoid-realloc-3-corner-case.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 430cd222921336dc9e06170c2e4a2e7024a8cadb Mon Sep 17 00:00:00 2001
-From: Justus Winter <4winter@informatik.uni-hamburg.de>
-Date: Mon, 16 Jun 2014 17:34:22 +0200
-Subject: [PATCH 4/5] libports: avoid realloc(3) corner case
-
-If the size argument is 0, realloc may either return NULL, or return a
-pointer that is only valid for use with free(3). In either case, the
-memory is freed. So if realloc would return NULL (it does not on
-GNU), the current code would double free p.
-
-Found using the Clang Static Analyzer.
-
-* libports/bucket-iterate.c (_ports_bucket_class_iterate): Avoid
-calling realloc if no ports were matched.
----
- libports/bucket-iterate.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
-index babc204..2d1b00d 100644
---- a/libports/bucket-iterate.c
-+++ b/libports/bucket-iterate.c
-@@ -65,7 +65,7 @@ _ports_bucket_class_iterate (struct port_bucket *bucket,
- }
- pthread_mutex_unlock (&_ports_lock);
-
-- if (n != nr_items)
-+ if (n != 0 && n != nr_items)
- {
- /* We allocated too much. Release unused memory. */
- void **new = realloc (p, n * sizeof *p);
---
-2.0.0
-