Skip to content

tftp 读取文件文件名为特定长度 会导致程序崩溃 #91

Description

@xkf321

如果读取slin.log.0, erpc.log.0 程序会崩溃 ,读取文件名为module.log.0 程序正常

调试后发现内存分配长度没有考虑\0, 由于malloc分配以字节对齐方式分配,当文件名不是对齐字节长度的整数倍,malloc会多分配一些字节以保证内存对齐,某些文件名长度正好是整数倍时,出现内存越界,导致程序崩溃

图片

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions