【问题标题】:buffer over flow i'm getting these error's缓冲区溢出我收到这些错误
【发布时间】:2014-02-10 14:33:40
【问题描述】:
#include <stdio.h>
int main(int argc, char *argv[]) {
char buffer[10];
strcpy(buffer, argv[1]);
printf("%s\n", &buffer);
}

我是怎么得到 gcc 错误的 警告:内置函数“strcpy”的隐式声明不兼容 当我做 gdb 它显示不同的 strcpy 0x080483a7:调用 0x80482b8“strcpy@plt>” 我不知道什么是plt..

【问题讨论】:

    标签: buffer-overflow strcpy


    【解决方案1】:

    添加标题

    #include <string.h>
    

    【讨论】:

    • 嗯我不太明白.. strcpy 和 strcpy@plt 有什么区别 这个 strcpy@plt 影响缓冲区溢出的实践吗?当我输入 disass strcpy 的推荐时,它会说“”在当前上下文中没有符号“strcpy”””
    • 不,它没有。 strcpy@plt 只是一个间接给定的方式,以便库可以加载到虚拟地址空间中的任何位置,而无需更改调用 strcpy 的每个位置的地址。
    猜你喜欢
    • 2017-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多