Skip to content

Commit

Permalink
log_xxd(): do not log with negative length
Browse files Browse the repository at this point in the history
Thanks to Godfrey Chung for the bug report
https://archives.neohapsis.com/archives/dev/muscle/2012-q1/0043.html


git-svn-id: svn:https://anonscm.debian.org/svn/pcsclite/trunk/PCSC@6229 0ce88b0d-b2fd-0310-8134-9614164e65ea
  • Loading branch information
LudovicRousseau committed Feb 21, 2012
1 parent 9ae5023 commit 8cba22a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/debuglog.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ void log_xxd(const int priority, const char *msg, const unsigned char *buffer,
|| (DEBUGLOG_NO_DEBUG == LogMsgType))
return;

/* len is an error value? */
if (len < 0)
return;

log_xxd_always(priority, msg, buffer, len);
} /* log_xxd */

Expand Down

0 comments on commit 8cba22a

Please sign in to comment.