[Bug c/105357] dereferenced ptr on param stack gets over written

vwebber at msn dot com gcc-bugzilla@gcc.gnu.org
Sat Apr 23 09:06:57 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105357

--- Comment #4 from vwebber <vwebber at msn dot com> ---
BTW, what happens in the rare occurrence of a bug report being found valid.  

Regards, 

Victor Webber
V&T: 408-221-8467 
V:      805-924-1953
vwebber@msn.com


-----Original Message-----
From: Victor Webber 
Sent: Saturday, April 23, 2022 2:04 AM
To: pinskia at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
Subject: RE: [Bug c/105357] dereferenced ptr on param stack gets over written

Thank you for the comments. 

However, the data being overwritten is on the stack in a function which is
called after the problematic scanf() etc are are run.

I would suggest running up GDB and do a break on access of the overwritten
lvalue.  

Regards, 

Victor Webber
V&T: 408-221-8467 
V:      805-924-1953
vwebber@msn.com


-----Original Message-----
From: pinskia at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org> 
Sent: Saturday, April 23, 2022 1:07 AM
To: vwebber@msn.com
Subject: [Bug c/105357] dereferenced ptr on param stack gets over written

https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgcc.gnu.org%2Fbugzilla%2Fshow_bug.cgi%3Fid%3D105357&data=05%7C01%7C%7Cccc94c12b24440504a1d08da25003521%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637862980067506332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Xv3EJ%2FCciXIGx8Y9sxvqo1rw9mcvMISwNFnGD5Dbowk%3D&reserved=0

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- You need
better error checking in your code.
scanf can fail and scanf with %s without a size can definitely have a buffer
overflow.

You might be able to detect some of this with -fsanitize=address or by using
valgrind.

This is almost definitely not a bug in GCC.

--
You are receiving this mail because:
You reported the bug.


More information about the Gcc-bugs mailing list