epicsStrnEscapedFromRaw may print inclomplete escape sequences

Bug #1943245 reported by Dirk Zimoch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
New
Undecided
Doug Murray

Bug Description

When epicsStrnEscapedFromRaw runs out of buffer space in the middle of an escape sequence, it prints incomplete and thus invalid sequences.
For example printing "\xff" (1 byte 0xff) into a buffer that is too short may result in `\`, `\x`, or `\xf`. In particular a stray `\` at the end may be misinterpreted for example when the escaped string itself is printed in quotes and then the outer ending quote gets "escaped".

Instead of printing incomplete sequences it should rather not print the sequence at all.

Tags: codeathon

Related branches

Andrew Johnson (anj)
tags: added: codeathon
Andrew Johnson (anj)
Changed in epics-base:
assignee: nobody → Doug Murray (dougmurray)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.