NULL pointer dereference in `print_job()` during MIME auto-detection

オープン 初心者向け
#1,826 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c
領域
backend, security

調査の方向性

scheduler/ipp.c の報告された8867行目付近にある print_job() から始めます。次に send_document() を調べ、各関数が mimeFileType() と mimeType() の NULL 戻り値をどのように処理するかを追跡します。MIME の自動検出に関する近くのテストを確認し、MIME 定義がない場合の両方の関数のテストを追加します。どちらの経路でも存在しない MIME タイプをデリファレンスせず、スケジューラーがリクエストの処理を続ければ完了です。

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

説明

Summary
An IPP client permitted to submit print jobs can crash cupsd if document auto-typing finds no MIME type and the configured MIME database cannot supply a fallback. The crash stops the scheduler, interrupting printing for all queues it serves.

Details
In scheduler/ipp.c, print_job() calls mimeFileType() to identify the document type and falls back to mimeType(). If both return NULL, it dereferences filetype in the log call and again in snprintf(). In the tested CUPS 2.4.19 build, the crash occurred in snprintf() at scheduler/ipp.c:8867.

In both tested configurations, cupsd continued accepting IPP requests without loading any MIME definitions. send_document() checks filetype before logging but still dereferences it in the following snprintf() call. Both code paths are present in CUPS 2.4.20 and at commit d473b41.

主要言語
C
スター
1.8k
フォーク
362
平均マージ
1日 46分
マージ済み PR(30日)
10

環境構築

はじめの一歩

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

OpenPrinting/cups のほかの issue

OpenPrinting/cups の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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