Menu

#8 src/base/omx_base_component.c: fix stack overread

Unstable (example)
open
nobody
None
5
2023-02-20
2023-02-20
No

gcc-12 is able to detect uuid type overred as:

In file included from ...-glibc-2.35-224-dev/include/string.h:535,
                 from omx_base_component.h:32,
                 from omx_base_component.c:34:
In function 'memcpy',
    inlined from 'omx_base_component_GetComponentVersion' at omx_base_component.c:830:3:
...-glibc-2.35-224-dev/include/bits/string_fortified.h:29:10: error: '__builtin_memcpy'
  forming offset [24, 71] is out of the bounds [0, 24] of object 'uuid' with type 'OMX_U32[3]'
    {aka 'long unsigned int[3]'} [-Werror=array-bounds]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
omx_base_component.c: In function 'omx_base_component_GetComponentVersion':
omx_base_component.c:810:11: note: 'uuid' declared here
  810 |   OMX_U32 uuid[3];
      |           ^~~~

The change sets toe size of uid for memcpy() call.

1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.