Re: PATCH] sms_decode_text(): Sanitize 8-bit data so that it is UTF8-clean.



On Tue, 2011-09-27 at 13:18 -0500, Dan Williams wrote:
> On Mon, 2011-09-26 at 18:29 -0400, Nathan Williams wrote:
> > This keeps ModemManager from crashing deep in the DBus libraries when
> > a SMS Get() or List() DBus operation finds a message that isn't valid
> > UTF-8 and/or has embedded NUL characters.
> > 
> > I'll be putting up a separate patch as a proposal for how to avoid
> > this problem in the new API.
> 
> Sounds fine; though in general we know the encoding that the message
> comes in with, and we know we need to convert to UTF-8 for D-Bus (and
> really, everything should be UTF-8 at the boundaries, it would be just
> horrid to expose any charset encoding details to clients and I don't
> think we have to).  So we should be able to convert to UTF-8 without any
> real loss of fidelity when reading the  message from the modem, and we
> should be able to convert from UTF-8 to a suitable charset (whatever
> we've selected from CSCS) when sending messages too.
> 
> In what cases would we want to send or receive essentially binary data
> via SMS?  AFAIK most of these cases show up as base64 or hex-string SMS
> if they aren't intended for human consumption.
> 
> In any case, applied, thanks!

But the patch does appear to break the testcases, could you send along a
patch to update those as well?

/test_pdu3_8bit: **
ERROR:test-sms.c:231:test_pdu3_8bit: assertion failed
(g_value_get_string(value) == ("\xe8\x32\x9b\xfd\x46\x97\xd9\xec\x37
\xde")): ("\\xe82\\x9b\\xfdF\\x97\\xd9\\xec7\\xde" == "\3502\233\375F
\227\331\3547\336")

Thanks,
Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]