Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memeory leak in goose_publisher_example.c #104

Open
RootUp opened this issue Jan 11, 2019 · 2 comments
Open

Memeory leak in goose_publisher_example.c #104

RootUp opened this issue Jan 11, 2019 · 2 comments

Comments

@RootUp
Copy link

RootUp commented Jan 11, 2019

Hi team,

Their are multiple memory leaks in goose_publisher_example.c

Snip goose_publisher_example.c

	LinkedList_add(dataSetValues, MmsValue_newIntegerFromInt32(1234));
	LinkedList_add(dataSetValues, MmsValue_newBinaryTime(false));
        LinkedList_add(dataSetValues, MmsValue_newIntegerFromInt32(5678));

Memory leaks

=================================================================
==1276==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 10 byte(s) in 1 object(s) allocated from:
    #0 0x7f98bdabdb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x55c2071bac8b in Memory_malloc /home/input0/Desktop/libiec61850/hal/memory/lib_memory.c:47
    #2 0x55c2071abca3 in Asn1PrimitiveValue_create /home/input0/Desktop/libiec61850/src/mms/asn1/asn1_ber_primitive_value.c:31
    #3 0x55c2071ac49b in BerInteger_createInt32 /home/input0/Desktop/libiec61850/src/mms/asn1/ber_integer.c:49
    #4 0x55c2071ac8e3 in BerInteger_createFromInt32 /home/input0/Desktop/libiec61850/src/mms/asn1/ber_integer.c:97
    #5 0x55c2071a27e1 in MmsValue_newIntegerFromInt32 /home/input0/Desktop/libiec61850/src/mms/iso_mms/common/mms_value.c:827
    #6 0x55c20719c192 in main /home/input0/Desktop/libiec61850/examples/goose_publisher/goose_publisher_example.c:30
    #7 0x7f98bd3f0b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 10 byte(s) in 1 object(s) allocated from:
    #0 0x7f98bdabdb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    #1 0x55c2071bac8b in Memory_malloc /home/input0/Desktop/libiec61850/hal/memory/lib_memory.c:47
    #2 0x55c2071abca3 in Asn1PrimitiveValue_create /home/input0/Desktop/libiec61850/src/mms/asn1/asn1_ber_primitive_value.c:31
    #3 0x55c2071ac49b in BerInteger_createInt32 /home/input0/Desktop/libiec61850/src/mms/asn1/ber_integer.c:49
    #4 0x55c2071ac8e3 in BerInteger_createFromInt32 /home/input0/Desktop/libiec61850/src/mms/asn1/ber_integer.c:97
    #5 0x55c2071a27e1 in MmsValue_newIntegerFromInt32 /home/input0/Desktop/libiec61850/src/mms/iso_mms/common/mms_value.c:827
    #6 0x55c20719c1d0 in main /home/input0/Desktop/libiec61850/examples/goose_publisher/goose_publisher_example.c:32
    #7 0x7f98bd3f0b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 5 byte(s) in 1 object(s) allocated from:
    #0 0x7f98bdabdd38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x55c2071bacc4 in Memory_calloc /home/input0/Desktop/libiec61850/hal/memory/lib_memory.c:59
    #2 0x55c2071abd39 in Asn1PrimitiveValue_create /home/input0/Desktop/libiec61850/src/mms/asn1/asn1_ber_primitive_value.c:35
    #3 0x55c2071ac49b in BerInteger_createInt32 /home/input0/Desktop/libiec61850/src/mms/asn1/ber_integer.c:49
    #4 0x55c2071ac8e3 in BerInteger_createFromInt32 /home/input0/Desktop/libiec61850/src/mms/asn1/ber_integer.c:97
    #5 0x55c2071a27e1 in MmsValue_newIntegerFromInt32 /home/input0/Desktop/libiec61850/src/mms/iso_mms/common/mms_value.c:827
    #6 0x55c20719c1d0 in main /home/input0/Desktop/libiec61850/examples/goose_publisher/goose_publisher_example.c:32
    #7 0x7f98bd3f0b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Direct leak of 5 byte(s) in 1 object(s) allocated from:
    #0 0x7f98bdabdd38 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded38)
    #1 0x55c2071bacc4 in Memory_calloc /home/input0/Desktop/libiec61850/hal/memory/lib_memory.c:59
    #2 0x55c2071abd39 in Asn1PrimitiveValue_create /home/input0/Desktop/libiec61850/src/mms/asn1/asn1_ber_primitive_value.c:35
    #3 0x55c2071ac49b in BerInteger_createInt32 /home/input0/Desktop/libiec61850/src/mms/asn1/ber_integer.c:49
    #4 0x55c2071ac8e3 in BerInteger_createFromInt32 /home/input0/Desktop/libiec61850/src/mms/asn1/ber_integer.c:97
    #5 0x55c2071a27e1 in MmsValue_newIntegerFromInt32 /home/input0/Desktop/libiec61850/src/mms/iso_mms/common/mms_value.c:827
    #6 0x55c20719c192 in main /home/input0/Desktop/libiec61850/examples/goose_publisher/goose_publisher_example.c:30
    #7 0x7f98bd3f0b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: 30 byte(s) leaked in 4 allocation(s).
@abergmann
Copy link

CVE-2019-6135 got assigned to this issue.

@mzillgith
Copy link
Contributor

Hi, it is required to provide an existing interface name and run with required permissions (e.g. running as root on linux).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants