File: 06-Fix-memory-errors.patch

package info (click to toggle)
ucl 1.03%2Brepack-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,364 kB
  • sloc: sh: 11,733; asm: 10,461; ansic: 5,070; makefile: 109
file content (35 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Robert Luberda <robert@debian.org>
Date: Wed, 29 Aug 2018 12:37:32 +0200
Subject: Fix memory errors shown by valgrind

Initialize memory in two places in ucl_swd.ch
to get rid of memory errors detected by valgrind
in a test program included in the bug report.

Bugs-Debian: https://bugs.debian.org/804474
---
 src/ucl_swd.ch | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ucl_swd.ch b/src/ucl_swd.ch
index abc0ae1..575d4de 100644
--- a/src/ucl_swd.ch
+++ b/src/ucl_swd.ch
@@ -330,7 +330,7 @@ int swd_init(ucl_swd_t *s, const ucl_bytep dict, ucl_uint dict_len)
     else
         s->rp += s->b_size - s->node_count;
 
-#if defined(__UCL_CHECKER)
+#if 1 /*defined(__UCL_CHECKER)*/
     /* initialize memory for the first few HEAD3 (if s->ip is not far
      * enough ahead to do this job for us). The value doesn't matter. */
     if (s->look < 3)
@@ -377,7 +377,7 @@ void swd_getbyte(ucl_swd_t *s)
     {
         if (s->look > 0)
             --s->look;
-#if defined(__UCL_CHECKER)
+#if 1 /*defined(__UCL_CHECKER)*/
         /* initialize memory - value doesn't matter */
         s->b[s->ip] = 0;
         if (s->ip < s->f)