sms: Don't crash when encoding fails

This commit is contained in:
Denis Kenzior 2010-11-02 10:50:03 -05:00
parent a05ebc93ab
commit 348bdb7f1d
1 changed files with 5 additions and 1 deletions

View File

@ -1138,7 +1138,11 @@ static gboolean compute_incoming_msgid(GSList *sms_list,
for (l = sms_list; l; l = l->next) {
s = l->data;
sms_encode(s, &len, NULL, buf);
if (sms_encode(s, &len, NULL, buf) == FALSE) {
g_checksum_free(checksum);
return FALSE;
}
g_checksum_update(checksum, buf, len);
}