Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

The cmark_markdown_to_html function call uses free to release crashes

オープン
#577 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
c

調査の方向性

cmark_markdown_to_html API から始めて、返されるバッファーがどのように確保され、ドキュメント化されているかを調べ、示されている Qt 呼び出し元でクラッシュを再現します。正しい所有権と解放の動作を特定し、変換とクリーンアップでクラッシュしなくなったことを確認します。

索引モデルが issue の本文から書いたものです。

説明

QString DeepSeekWidgetUI::convertMarkdownToHtml(const QString& markdown)
{
QByteArray byteArray = markdown.toUtf8();
const char* markdownCString = byteArray.constData();

char* html = cmark_markdown_to_html(markdownCString, strlen(markdownCString), CMARK_OPT_DEFAULT);
if (html == NULL)
{
	return markdown;
}

QString htmlText = QString::fromUtf8(html);

free(html);

return htmlText;

}

After calling the cmark_markdown_to_html function, I copied the data to the QString, then released the memory and crashed directly. I thought it was a problem with the QString::fromUtf8() function, so I tested it and executed free() before QString::fromUtf8(), and it crashed as well.

This is the result of the call after QString::fromUtf8()
Image

This is the result of the call before QString::fromUtf8()

Image

主要言語
C
スター
2k
フォーク
700
平均マージ
3日 9時間
マージ済み PR(30日)
5

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

commonmark/cmark のほかの issue

commonmark/cmark の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。