Skip to content

修复 chsrc_make_tmpfile 在win上错误处理不完善的问题#298

Merged
ccmywish merged 2 commits into
RubyMetric:devfrom
Mikachu2333:fix/create_tmpfile
Oct 6, 2025
Merged

修复 chsrc_make_tmpfile 在win上错误处理不完善的问题#298
ccmywish merged 2 commits into
RubyMetric:devfrom
Mikachu2333:fix/create_tmpfile

Conversation

@Mikachu2333

Copy link
Copy Markdown
Collaborator

问题描述

  1. patch core.c 修改函数实现 #294

方案与实现

  1. 修复了 ccmywish 提到的格式问题、无用的额外赋值问题等
  2. 在 Windows 上使用 GetTempPathGetTempFileName 创建临时文件(这也是winapi推荐的标准方式)并且这样的话理论上也可以大幅避免注入攻击或者临时文件存在等问题
  3. 增加了一点错误处理,上次没考虑全,漏情况了

Mikachu2333 added 2 commits October 6, 2025 00:29
1. 改进了获取新创建文件名的方式
2. 改进了内存泄漏问题

@ccmywish ccmywish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好代码 👍

@ccmywish ccmywish merged commit 31c93f0 into RubyMetric:dev Oct 6, 2025
3 of 4 checks passed
@ccmywish ccmywish added this to the v0.2.3 milestone Oct 6, 2025
@ccmywish ccmywish added 改善加强 改善加强 Windows Windows相关 labels Oct 6, 2025
@Mikachu2333 Mikachu2333 deleted the fix/create_tmpfile branch October 6, 2025 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Windows Windows相关 改善加强 改善加强

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants