`get_options()` repeats the first byte when hex-encoding octet strings

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

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

@rue19 がすでに取り組んでいます。

2026年11月26日 から。

  • #1831 @rue19 による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c
領域
backend

調査の方向性

scheduler/job.cで、get_options()内の16進出力ループを調べ、隣接する引用符付き文字列の分岐で入力ポインターをどのように進めているか比較してください。入力バイトごとに順番に2桁の16進数を出力するようループを変更してください。41 0A 42が414141ではなく410A42としてエンコードされれば完了です。Issueにはテストが指定されていないため、印刷フィルターのオプションエンコードを検証する既存のテストを探してください。

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

説明

In scheduler/job.c, the hexadecimal branch of get_options() advances the output pointer but not the input pointer. Each iteration formats *valptr, so a multi-byte octet string that takes this branch is serialized as repetitions of its first byte. Print filters receive a different value from the one supplied.

Expected: Emit two hexadecimal digits for each input byte, in order.

Actual: The first byte is emitted once per input byte. For example, at the encoder level, 41 0A 42 should become <410A42> but the loop produces <414141>. This example is derived from the loop, not an end-to-end print test.

Suggested fix: Advance valptr once per iteration in the hex output loop, as the neighboring quoted-string branch already does.

The hex output loop was introduced in commit 5483fd294, which addressed Apple CUPS issue #5558. That issue concerned handling length-delimited octet strings, not this repeated-byte defect. The later octet-string scan fix advances the pointer while deciding whether to hex-encode, but does not change the hex output loop.

主要言語
C
スター
1.8k
フォーク
367
平均マージ
12時間 18分
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

OpenPrinting/cups のほかの issue

OpenPrinting/cups の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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