mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
common,tools: Always escape newlines when escaping data.
* common/stringhelp.c (do_percent_escape): Always escape newlines. * tools/gpgconf-comp.c (gc_percent_escape): Likewise. -- Newlines always pose a problem for a line-based communication format. GnuPG-bug-id: 2387 Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
3cdb792007
commit
e064c75b08
2 changed files with 16 additions and 1 deletions
|
@ -1491,6 +1491,13 @@ gc_percent_escape (const char *src)
|
|||
*(dst++) = '2';
|
||||
*(dst++) = 'c';
|
||||
}
|
||||
else if (*src == '\n')
|
||||
{
|
||||
/* The newline is problematic in a line-based format. */
|
||||
*(dst++) = '%';
|
||||
*(dst++) = '0';
|
||||
*(dst++) = 'a';
|
||||
}
|
||||
else
|
||||
*(dst++) = *(src);
|
||||
src++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue