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

--- Comment #3 from vwebber <vwebber at msn dot com> ---
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
vweb...@msn.com


-----Original Message-----
From: pinskia at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> 
Sent: Saturday, April 23, 2022 1:07 AM
To: vweb...@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&amp;data=05%7C01%7C%7Cccc94c12b24440504a1d08da25003521%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637862980067506332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Xv3EJ%2FCciXIGx8Y9sxvqo1rw9mcvMISwNFnGD5Dbowk%3D&amp;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.

Reply via email to