Added patch to fix size of allocated ranges block.

This commit is contained in:
Sebastian Lackner
2017-09-30 16:26:16 +02:00
parent f7fdbd9bbf
commit 4c7e1e892a
2 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
From 9a80755fe1afdfabb07a53fb58f858cc0ab3634c Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 30 Sep 2017 16:25:21 +0200
Subject: server: Fix size of allocated ranges block (Coverity).
---
server/mapping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/mapping.c b/server/mapping.c
index 8459c316559..22cd5c2064d 100644
--- a/server/mapping.c
+++ b/server/mapping.c
@@ -682,7 +682,7 @@ static struct ranges *create_ranges(void)
if (!ranges) return NULL;
ranges->count = 0;
ranges->max = 8;
- if (!(ranges->ranges = mem_alloc( ranges->max * sizeof(ranges->ranges) )))
+ if (!(ranges->ranges = mem_alloc( ranges->max * sizeof(*ranges->ranges) )))
{
release_object( ranges );
return NULL;
--
2.14.1