Files
ucl/06-Fix-memory-errors.patch
Martin Pluskal 969e86bb51 Accepting request 985184 from home:elvigia:branches:Archiving
- Import debian patch sets. This fixes some bugs and 
  allows us to build the library without any special CFLAGS

- Add ucl-noexecstack.patch: Fix FTBS on i586 due to executable
  stack

OBS-URL: https://build.opensuse.org/request/show/985184
OBS-URL: https://build.opensuse.org/package/show/Archiving/ucl?expand=0&rev=11
2022-06-27 09:46:40 +00:00

36 lines
1.1 KiB
Diff

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)