Package: libucl-dev
Version: 1.03-5

Memory errors are detected by valgrind in the following program:

    // Compile: gcc test.c -g -o test.exe -lucl

    #include <string.h>

    #include <ucl/ucl.h>

    #define COMPRESSED_LEN 1024

    int main() {
        const char* uncompressed = "test test test";
        char compressed[COMPRESSED_LEN];
        ucl_uint compressed_len = COMPRESSED_LEN;
        ucl_progress_callback_p callback = NULL;
        int level = 7;
        struct ucl_compress_config_p conf = NULL;
        ucl_uintp result = NULL;
        ucl_nrv2b_99_compress(
            uncompressed,
            strlen(uncompressed),
            compressed,
            &compressed_len,
            callback,
            level,
            conf,
            result
        );
        return 0;
    }

Valgrind output is as follows:

    ==1681== Memcheck, a memory error detector
    ==1681== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
    ==1681== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for
copyright info
    ==1681== Command: ./test.exe
    ==1681==
    ==1681== Use of uninitialised value of size 8
    ==1681==    at 0x4E38FF3: swd_accept (ucl_swd.ch:460)
    ==1681==    by 0x4E396E6: find_match (ucl_mchw.ch:136)
    ==1681==    by 0x4E3A63E: ucl_nrv2b_99_compress (n2_99.ch:590)
    ==1681==    by 0x40080A: main (test.c:15)
    ==1681==
    ==1681== Use of uninitialised value of size 8
    ==1681==    at 0x4E39013: swd_accept (ucl_swd.ch:461)
    ==1681==    by 0x4E396E6: find_match (ucl_mchw.ch:136)
    ==1681==    by 0x4E3A63E: ucl_nrv2b_99_compress (n2_99.ch:590)
    ==1681==    by 0x40080A: main (test.c:15)
    ==1681==
    ==1681== Use of uninitialised value of size 8
    ==1681==    at 0x4E39051: swd_accept (ucl_swd.ch:463)
    ==1681==    by 0x4E396E6: find_match (ucl_mchw.ch:136)
    ==1681==    by 0x4E3A63E: ucl_nrv2b_99_compress (n2_99.ch:590)
    ==1681==    by 0x40080A: main (test.c:15)
    ==1681==
    ==1681== Use of uninitialised value of size 8
    ==1681==    at 0x4E39091: swd_accept (ucl_swd.ch:470)
    ==1681==    by 0x4E396E6: find_match (ucl_mchw.ch:136)
    ==1681==    by 0x4E3A63E: ucl_nrv2b_99_compress (n2_99.ch:590)
    ==1681==    by 0x40080A: main (test.c:15)
    ==1681==
    ==1681== Use of uninitialised value of size 8
    ==1681==    at 0x4E393B4: swd_findbest (ucl_swd.ch:615)
    ==1681==    by 0x4E39742: find_match (ucl_mchw.ch:150)
    ==1681==    by 0x4E3A63E: ucl_nrv2b_99_compress (n2_99.ch:590)
    ==1681==    by 0x40080A: main (test.c:15)
    ==1681==
    ==1681== Use of uninitialised value of size 8
    ==1681==    at 0x4E393D2: swd_findbest (ucl_swd.ch:616)
    ==1681==    by 0x4E39742: find_match (ucl_mchw.ch:150)
    ==1681==    by 0x4E3A63E: ucl_nrv2b_99_compress (n2_99.ch:590)
    ==1681==    by 0x40080A: main (test.c:15)
    ==1681==
    ==1681== Use of uninitialised value of size 8
    ==1681==    at 0x4E39419: swd_findbest (ucl_swd.ch:620)
    ==1681==    by 0x4E39742: find_match (ucl_mchw.ch:150)
    ==1681==    by 0x4E3A63E: ucl_nrv2b_99_compress (n2_99.ch:590)
    ==1681==    by 0x40080A: main (test.c:15)
    ==1681==
    ==1681== Use of uninitialised value of size 8
    ==1681==    at 0x4E3959B: swd_findbest (ucl_swd.ch:671)
    ==1681==    by 0x4E39742: find_match (ucl_mchw.ch:150)
    ==1681==    by 0x4E3A63E: ucl_nrv2b_99_compress (n2_99.ch:590)
    ==1681==    by 0x40080A: main (test.c:15)
    ==1681==
    ==1681==
    ==1681== HEAP SUMMARY:
    ==1681==     in use at exit: 0 bytes in 0 blocks
    ==1681==   total heap usage: 6 allocs, 6 frees, 809,216 bytes allocated
    ==1681==
    ==1681== All heap blocks were freed -- no leaks are possible
    ==1681==
    ==1681== For counts of detected and suppressed errors, rerun with: -v
    ==1681== Use --track-origins=yes to see where uninitialised values come from
    ==1681== ERROR SUMMARY: 11 errors from 8 contexts (suppressed: 0 from 0)

I am using Debian GNU/Linux 7.9, kernel 3.2.0-4-amd64 and libc6 2.19-7.

Reply via email to