Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发帖空文 #31

Open
IronBlood opened this issue Apr 21, 2021 · 3 comments
Open

发帖空文 #31

IronBlood opened this issue Apr 21, 2021 · 3 comments
Assignees
Labels

Comments

@IronBlood
Copy link
Member

有过成功的创建文章记录,但之后的几次创建正文为空,且文件格式也有些奇怪。感觉属于偶发。且回复标题中多了一个空格。

@IronBlood IronBlood added the bug label Apr 21, 2021
@IronBlood IronBlood self-assigned this Apr 21, 2021
@IronBlood
Copy link
Member Author

创建失败包括发布和回复

@IronBlood
Copy link
Member Author

从现有的案例看空文其实截断发生在说明档,且下一个字符都是 gbk 编码的中文:

发信人: vantasy (
发信人: liuche (Abubble|WHH|

代码中 do_article_post 传入的 nickname 来自于 PASSWDS文件,使用 GBK 编码。而传入 do_article_post 后被 snprintf 保存到 content_utf8_buf 缓冲区中,交给下一步 u2g 肯定是不合适的。

另一方面在 api_article.c 中,在调用完 json_object_put(req_json) 后依然使用了 title data 这些指向 req_json 内部数据的指针。在之前的测试中能够发帖,可能仅因为对应的内存区域尚未被清理。

@IronBlood
Copy link
Member Author

相关变更:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant