Re: PATCH] sms_decode_text(): Sanitize 8-bit data so that it is UTF8-clean.
- From: "Andrew Bird (Sphere Systems)" <ajb spheresystems co uk>
- To: networkmanager-list gnome org
- Subject: Re: PATCH] sms_decode_text(): Sanitize 8-bit data so that it is UTF8-clean.
- Date: Tue, 27 Sep 2011 19:37:06 +0100
On Tuesday 27 September 2011, 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!
>
> Dan
>
> > - Nathan
> >
> > _______________________________________________
> > networkmanager-list mailing list
> > networkmanager-list gnome org
> > http://mail.gnome.org/mailman/listinfo/networkmanager-list
>
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list
Hi Dan,
Here's a case you might want to consider. Sometimes mobile networks send
WAP pushes to signify that an MMS is ready for retrieval, or send the user
revised phone settings etc. Now we can't currently do much with those but they
are binary and can contain embedded \x00 which Dbus really won't transfer in a
string. But it's no good just ignoring them and not showing the client the
message because they take up valuable SIM based SMS slots, if we did then the
user would not know of their existence and eventually the SIM would silently
fill. I had one WAP push last week that spanned 4 SMS slots. On Wader we worked
around this problem by Zipping and Base64 encoding the message before sending
over Dbus [0] [1], but I couldn't think of a elegant solution without changing
the spec. If you come up with a better solution please let me know and we can
revise what we have.
[0]:https://forge.betavine.net/plugins/scmsvn/viewcvs.php/trunk/src/core/wader/common/mal.py?root=bcm&rev=1210&r1=1193&r2=1210
[1]:https://forge.betavine.net/plugins/scmsvn/viewcvs.php/trunk/src/core/wader/common/encoding.py?root=bcm&rev=1210&r1=1194&r2=1210
Andrew
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]