tack smashing detected 错误的处理

编程入门 行业动态 更新时间:2024-10-25 10:25:36

tack smashing detected <a href=https://www.elefans.com/category/jswz/34/1771449.html style=错误的处理"/>

tack smashing detected 错误的处理

分配空间不足引起的错误:‘Stack smashing detected’    

在程序编译的时候,加上一个选项即可:"-fno-stack-protector"

举个简单的例子,比如,原来编译时使用的命令为:

gcc -o xxxx source.c

则需要改为:

gcc -o xxxx "-fno-stack-protector" source.c

如果是通过makefile文件进行编译,除了那个生成最终二进制文件的编译命令之外,记得将其中每个“.o”文件的编译命令中也加上"-fno-stack-protector",最好直接将这个选项加到环境变量中。

 

是在该函数的结束时return 报错,在该函数的开头声明uint8_t data[32]  改为data[60];因为函数用到了申请data[60]

更多推荐

tack smashing detected 错误的处理

本文发布于:2024-03-11 16:32:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1729402.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   tack   smashing   detected

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!