This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c5d613  PROTON-2123 Escape every char >127 printed into logs (#197)
4c5d613 is described below

commit 4c5d61398d279571d64234c9f8edec040274eb4a
Author: Jiří Daněk <[email protected]>
AuthorDate: Wed Oct 23 19:17:58 2019 +0200

    PROTON-2123 Escape every char >127 printed into logs (#197)
    
    * PROTON-2123 Escape every char >127 printed into logs
    
    * Fix random typo
---
 c/src/core/transport.c | 2 +-
 c/src/core/util.c      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/c/src/core/transport.c b/c/src/core/transport.c
index 9caa79d..ff4162e 100644
--- a/c/src/core/transport.c
+++ b/c/src/core/transport.c
@@ -979,7 +979,7 @@ static int pni_post_amqp_transfer_frame(pn_transport_t 
*transport, uint16_t ch,
   unsigned framecount = 0;
   pn_buffer_t *frame = transport->frame;
 
-  // create preformatives, assuming 'more' flag need not change
+  // create performatives, assuming 'more' flag need not change
 
  compute_performatives:
   pn_data_clear(transport->output_args);
diff --git a/c/src/core/util.c b/c/src/core/util.c
index 39bea4d..2aa3076 100644
--- a/c/src/core/util.c
+++ b/c/src/core/util.c
@@ -38,7 +38,8 @@ ssize_t pn_quote_data(char *dst, size_t capacity, const char 
*src, size_t size)
   for (unsigned i = 0; i < size; i++)
   {
     uint8_t c = src[i];
-    if (isprint(c)) {
+    // output printable ASCII, ensure '\' always introduces hex escape
+    if (c < 128 && c != '\\' && isprint(c)) {
       if (idx < (int) (capacity - 1)) {
         dst[idx++] = c;
       } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to