Unable to properly convert Orange Spain provider string (from +COPS) to UTF-8

Bug #1049426 reported by Mathieu Trudel-Lapierre on 2012-09-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ModemManager
Fix Released
Medium
modemmanager (Ubuntu)
High
Unassigned
Precise
High
Unassigned

Bug Description

This appears to be reproducible quite well with Orange in Spain. Bug opened on behalf of Chris Hemsing. This is an SRU candidate for ModemManager in 12.04 if the patch can be cherry-picked and doesn't need to many modifications.

"
There is a problem with the charset, which finally leads to a SIGSEGV in
g_utf8_validate called from parse_operator.

The modem is a
Bus 002 Device 003: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800
HSDPA Modem

Kernel:
3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 x86_64
x86_64 GNU/Linux

What happens:

parse_operator gets called

parse_operator (reply=0x674cc0 "+COPS: 0,0,\"Orange\241\",2",
cur_charset=MM_MODEM_CHARSET_UCS2) at mm-generic-gsm.c:2856

after the regexep, correctly

(gdb) p operator
$1 = 0x67e2e0 "Orange\241"

However, "Orange\241" is not UCS2 and therefore

operator = mm_charset_take_and_convert_to_utf8 (operator,
MM_MODEM_CHARSET_UCS2);

returns 0x0 !

The variable "operator" is not being checked and this leads to a call of

g_utf8_validate (str=0x0 (operator), max_len=-1, end=0x0)

g_utf8_validate then hits the SIGSEGV.
"

Changed in modemmanager (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Changed in modemmanager (Ubuntu Precise):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)

Weird... I'm in Spain and guess what operator I use for testing... :-)

Will try to hack a patch for this

If you're cherry-picking, you may also want to get this one:
http://cgit.freedesktop.org/ModemManager/ModemManager/commit/?h=MM_06&id=219424a6e2d017491a05ecbed661bccde3f991ef

It's a fix on top of Dan's fix.

Thanks Aleksander :)

Yeah, I think this is really specific to the exact Huawei model used, and possibly to firmware. Unfortunately I don't have further details about the model, but it's irrelevant since this is fixed.

Changed in modemmanager:
importance: Unknown → Medium
status: Unknown → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package modemmanager - 0.6.0.0-0ubuntu2

---------------
modemmanager (0.6.0.0-0ubuntu2) quantal; urgency=low

  * debian/patches/git_better_handle_ucs2_convert_e07c216.patch,
    debian/patches/git_skip_add_utf8_check_219424a.patch: fix UCS2 conversion
    for some Huawei devices which return "garbage" along with the response for
    the +COPS command. (LP: #1049426)
 -- Mathieu Trudel-Lapierre <email address hidden> Fri, 14 Sep 2012 14:15:15 -0400

Changed in modemmanager (Ubuntu):
status: Triaged → Fix Released
Changed in modemmanager (Ubuntu):
assignee: Mathieu Trudel-Lapierre (mathieu-tl) → nobody
Changed in modemmanager (Ubuntu Precise):
assignee: Mathieu Trudel-Lapierre (mathieu-tl) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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