Menu

#468 compile warnings about out of bounds access

current stable SDK
open
nobody
None
5
2024-06-15
2024-06-15
Jon Daniel
No

In file included from ../../include/path.h:8,
from ../../include/IMeshLoader.h:9,
from CDMFLoader.h:33,
from CDMFLoader.cpp:24:
In member function ‘irr::core::string<t, talloc="">& irr::core::string<t, talloc="">::append(T) [with T = char; TAlloc = irr::core::irrAllocator<char>]</char>’,
inlined from ‘void irr::scene::CDMFLoader::addMaterialPath(irr::core::stringc&, const irr::core::stringc&)’ at CDMFLoader.cpp:59:22,
inlined from ‘void irr::scene::CDMFLoader::addMaterialPath(irr::core::stringc&, const irr::core::stringc&)’ at CDMFLoader.cpp:51:6:
../../include/irrString.h:640:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
640 | array[used-1] = 0;
| ~~~~~~~~~~~~~~^~~
In file included from ../../include/irrString.h:9:
In member function ‘void irr::core::irrAllocator<t>::internal_new(size_t) [with T = char]’,
inlined from ‘T</t>
irr::core::irrAllocator<t>::allocate(size_t) [with T = char]’ at ../../include/irrAllocator.h:35:26,
inlined from ‘irr::core::string<t, talloc="">& irr::core::string<t, talloc="">::operator=(const irr::core::string<t, talloc="">&) [with T = char; TAlloc = irr::core::irrAllocator<char>]</char>’ at ../../include/irrString.h:340:30,
inlined from ‘irr::core::string<t, talloc="">::string(const irr::core::string<t, talloc="">&) [with T = char; TAlloc = irr::core::irrAllocator<char>]</char>’ at ../../include/irrString.h:111:9,
inlined from ‘void irr::scene::CDMFLoader::addMaterialPath(irr::core::stringc&, const irr::core::stringc&)’ at CDMFLoader.cpp:58:37,
inlined from ‘void irr::scene::CDMFLoader::addMaterialPath(irr::core::stringc&, const irr::core::stringc&)’ at CDMFLoader.cpp:51:6:
../../include/irrAllocator.h:60:36: note: at offset 4294967295 into destination object of size [0, 4294967295] allocated by ‘operator new’
60 | return operator new(cnt);
| ~~~~~~~~~~~~^~~~~
../../include/irrAllocator.h:60:36: note: at offset 4294967295 into destination object of size [0, 4294967295] allocated by ‘operator new’
../../include/irrAllocator.h:60:36: note: at offset 4294967295 into destination object of size [0, 4294967295] allocated by ‘operator new’
../../include/irrAllocator.h:60:36: note: at offset 4294967295 into destination object of size [0, 4294967295] allocated by ‘operator new’</t,></t,></t,></t,></t,></t></t,></t,>

In file included from ../../include/path.h:8,
from ../../include/ITexture.h:12,
from ../../include/IVideoDriver.h:10,
from CNullDriver.h:8,
from CNullDriver.cpp:5:
In member function ‘irr::core::string<t, talloc="">& irr::core::string<t, talloc="">::append(const T, irr::u32) [with T = char; TAlloc = irr::core::irrAllocator<char>]</char>’,
inlined from ‘irr::core::string<t, talloc="">& irr::core::string<t, talloc="">::append(const T</t,></t,>
, irr::u32) [with T = char; TAlloc = irr::core::irrAllocator<char>]</char>’ at ../../include/irrString.h:649:20,
inlined from ‘irr::core::string<t, talloc=""> irr::core::string<t, talloc="">::operator+(const B) const [with B = char; T = char; TAlloc = irr::core::irrAllocator<char>]</char>’ at ../../include/irrString.h:421:13,
inlined from ‘virtual void irr::video::CNullDriver::fillMaterialStructureFromAttributes(irr::video::SMaterial&, irr::io::IAttributes
)’ at CNullDriver.cpp:2287:104:
../../include/irrString.h:671:39: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
671 | array[l+used] = (other+l);
| ~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from ../../include/IImage.h:12,
from ../../include/ITexture.h:9:
In member function ‘void
irr::core::irrAllocator<t>::internal_new(size_t) [with T = char]’,
inlined from ‘T irr::core::irrAllocator<t>::allocate(size_t) [with T = char]’ at ../../include/irrAllocator.h:35:26,
inlined from ‘irr::core::string<t, talloc="">& irr::core::string<t, talloc="">::operator=(const irr::core::string<t, talloc="">&) [with T = char; TAlloc = irr::core::irrAllocator<char>]</char>’ at ../../include/irrString.h:340:30,
inlined from ‘irr::core::string<t, talloc="">::string(const irr::core::string<t, talloc="">&) [with T = char; TAlloc = irr::core::irrAllocator<char>]</char>’ at ../../include/irrString.h:111:9,
inlined from ‘irr::core::string<t, talloc=""> irr::core::string<t, talloc="">::operator+(const B</t,></t,></t,></t,></t,></t,></t,></t>
) const [with B = char; T = char; TAlloc = irr::core::irrAllocator<char>]</char>’ at ../../include/irrString.h:420:20,
inlined from ‘virtual void irr::video::CNullDriver::fillMaterialStructureFromAttributes(irr::video::SMaterial&, irr::io::IAttributes*)’ at CNullDriver.cpp:2287:104:
../../include/irrAllocator.h:60:36: note: at offset 4294967295 into destination object of size [1, 4294967295] allocated by ‘operator new’
60 | return operator new(cnt);
| ~~~~~~~~~~~~^~~~~</t></t,></t,></t,></t,>

Discussion


Log in to post a comment.