This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=b9665196413beb1577df1ee06591befb9e6bc143

commit b9665196413beb1577df1ee06591befb9e6bc143
Author: Guillem Jover <[email protected]>
AuthorDate: Fri Feb 1 03:38:54 2019 +0100

    libdpkg: Fix unit test for file_slurp()
    
    We should compare only the memory being used, and file_slurp() does not
    guarantee NUL-terminating the varbuf.
    
    Closes: #920974
    Diagnosed-by: Frank Schaefer <[email protected]>
---
 debian/changelog    | 3 +++
 lib/dpkg/t/t-file.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index f40d92008..c8ca1b00c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -69,6 +69,9 @@ dpkg (1.19.5) UNRELEASED; urgency=medium
     - Remove trailing whitespace from changelog.
     - Remove Origin and Bugs fields from control file.
     - Include a bug-script to report on tainted merged-usr-via-symlinks.
+  * Test suite:
+    - libdpkg: Fix unit test for file_slurp(). Closes: #920974
+      Diagnosed by Frank Schaefer <[email protected]>.
 
   [ Updated programs translations ]
   * German (Sven Joachim).
diff --git a/lib/dpkg/t/t-file.c b/lib/dpkg/t/t-file.c
index db900a5e3..ca68eaefe 100644
--- a/lib/dpkg/t/t-file.c
+++ b/lib/dpkg/t/t-file.c
@@ -80,7 +80,7 @@ test_file_slurp(void)
 
        test_pass(file_slurp(test_file, &vb, &err) == 0);
        test_pass(vb.used == strlen(ref_data));
-       test_str(vb.buf, ==, ref_data);
+       test_mem(vb.buf, ==, ref_data, min(vb.used, strlen(ref_data)));
        test_pass(err.syserrno == 0);
        test_pass(err.type == DPKG_MSG_NONE);
        varbuf_destroy(&vb);

-- 
Dpkg.Org's dpkg

Reply via email to