g10: Fix garbled status messages in NOTATION_DATA
authorWerner Koch <wk@gnupg.org>
Tue, 14 Jun 2022 09:33:27 +0000 (11:33 +0200)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 1 Jul 2022 16:06:43 +0000 (17:06 +0100)
commite47012eb052ca6be44c1f2bb46506c2e6235eda9
treed208e9586c49a24401bb6203f11e84782e314a4c
parent9e2f51d04320c11b39ec4773c0e2bb6fc3fd3743
g10: Fix garbled status messages in NOTATION_DATA

* g10/cpr.c (write_status_text_and_buffer): Fix off-by-one
--

Depending on the escaping and line wrapping the computed remaining
buffer length could be wrong.  Fixed by always using a break to
terminate the escape detection loop.  Might have happened for all
status lines which may wrap.

GnuPG-bug-id: T6027
(cherry picked from commit 34c649b3601383cd11dbc76221747ec16fd68e1b)

Gbp-Pq: Topic from-master
Gbp-Pq: Name g10-Fix-garbled-status-messages-in-NOTATION_DATA.patch
g10/cpr.c