tp-glib doesn't check there is actually a second message-part before accessing it (telepathy-glib/message-mixin.c:654), if your CM is broken this will cause a crash. It would be much better to generate a critical-warning that the CM is broken and do something to recover.
Actually now I've stared at this properly, I'm pretty sure it's actually an off-by-one error, we should be requesting part 0 (the header). http://cgit.collabora.com/git/user/danni/telepathy-glib.git/log/?h=crash-38060
There is a shocking lack of test coverage here too :(
Not a tp-glib reviewer, but: Looks good to me. - if (echo != NULL) + if (echo != NULL && echo->len >= 1) I guess echo->len should always be > 0, right? If so perhaps a g_warning or a DEBUG could be useful in order to notice the problem and fix the CMs.
Good catch. I echo comment 2, and comment 3. It's an error to include an echo with no parts. It's hard to do, since tp_cm_message_new() requires initial_parts to be ≥1. So a warning wouldn't hurt, but I don't think it's absolutely essential, because the CM developer would have to go out of their way to get into this situation.
Updated to include a warning.
Merged to 0.14 and to master, thanks.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.