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

未关闭 适合新手
#1,826 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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 分钟
30 天内合并 PR
10

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OpenPrinting/cups 的其他 Issue

查看 OpenPrinting/cups 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。