[ playerstage-Patches-3007996 ] Strings created by EncodeHex are not null-terminated

"SourceForge.net" <[email protected]>
Newsgroups gmane.science.robotics.playerstage
Message-ID <[email protected]>
Patches item #3007996, was opened at 2010-05-27 17:08
Message generated for change (Tracker Item Submitted) made by bst00
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=433166&aid=3007996&group_id=42445

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Player
Group: Unstable
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Sebastian Scherer (bst00)
Assigned to: Brian Gerkey (gerkey)
Summary: Strings created by EncodeHex are not null-terminated

Initial Comment:
The function EncodeHex in server/drivers/encode.cc does not null-terminate the c-strings it writes.

This in itself might just be unfavorable design and not a bug, but the writelog driver in WriteLog::WriteCamera assumes this string to be null-terminated. This leads to writelog writing strings for images that are too long (appending junk until a \0 is found), which in turn leads to ReadLog failing the assertion in ReadLog::ParseCamera:1530 once such a corrupted logfile is replayed.

The only other usage of EncodeHex seems to be in WriteLog::WriteRFID, where the whole string is properly set to \0 before calling EncodeHex.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=433166&aid=3007996&group_id=42445

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.