commit 5a9334f329a4938f0db57187e95d8c017dd1c5cc (HEAD -> develop,
origin/develop)
Author: ztrisur <[email protected]>
Date: Fri Mar 19 16:15:14 2021 +1100
imm: valgrind reports invalid read in imm agent [#2656]
The attrName.size includes the null character in the attrName.buf.
So only 'size' memory should be allocated and copied and not (size+1)
strncpy will copy minimum of attrName.size and attrName.buf, In normal
scenarios this should be attrName.buf
But in case buf is corrupt and extends beyond attrName.size. attrName.size
characters are copied, in this case setting the last character to '\0'
is important
---
** [tickets:#2656] imm: valgrind reports invalid read in imm agent**
**Status:** review
**Milestone:** 5.21.06
**Created:** Thu Oct 26, 2017 04:15 AM UTC by Vu Minh Nguyen
**Last Updated:** Sun Mar 21, 2021 11:34 PM UTC
**Owner:** Surbhi Tripathi
Here is valgrind report:
> ==740== Thread 4:
> ==740== Invalid read of size 1
> ==740== at 0x4C2E7A0: __strncpy_sse2_unaligned (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==740== by 0x5055CF2: strncpy (string3.h:120)
> ==740== by 0x5055CF2: imma_proc_ccbaug_setup(imma_client_node*,
> imma_callback_info*) (imma_proc.cc:2058)
> ==740== by 0x505C507: imma_hdl_callbk_dispatch_one(imma_cb*, unsigned long
> long) (imma_proc.cc:1745)
> ==740== by 0x5050D33: saImmOiDispatch (imma_oi_api.cc:638)
> ==740== by 0x120AD1: oi_thread (test_saImmOiSaStringT.c:287)
> ==740== by 0x5725183: start_thread (pthread_create.c:312)
> ==740== by 0x5A3537C: clone (clone.S:111
---
Sent from sourceforge.net because [email protected] is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list._______________________________________________
Opensaf-tickets mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets