summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2017-08-30 19:54:54 -0300
committerdequis <dx@dxzone.com.ar>2017-08-30 19:54:54 -0300
commite460983b98aa29c222b3990c41c16355d8fe78a1 (patch)
tree13fab1246b859235f94d7a0959955569389179dc
parentcdc41b66d21e4758d22d9cbc0e8ce84bc79ce95f (diff)
downloadbitlbee-facebook-e460983b98aa29c222b3990c41c16355d8fe78a1.tar.gz
Fix "Failed to read thrift" with unknown fields in /t_p payload
>Login error: Failed to read thrift: facebook-api.c:1815 >fb_api_cb_publish_pt: assertion 'FALSE' failed
-rw-r--r--facebook/facebook-api.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/facebook/facebook-api.c b/facebook/facebook-api.c
index 4661ef4..fb0581d 100644
--- a/facebook/facebook-api.c
+++ b/facebook/facebook-api.c
@@ -1853,8 +1853,18 @@ fb_api_cb_publish_pt(FbThrift *thft, GSList **press, GError **error)
FB_API_TCHK(fb_thrift_read_i64(thft, NULL));
break;
+ case 6:
+ /* Unknown new field */
+ FB_API_TCHK(type == FB_THRIFT_TYPE_I64);
+ FB_API_TCHK(fb_thrift_read_i64(thft, NULL));
+ break;
+
default:
- FB_API_TCHK(FALSE);
+ /* Try to read unknown fields as varint */
+ FB_API_TCHK(type == FB_THRIFT_TYPE_I16 ||
+ type == FB_THRIFT_TYPE_I32 ||
+ type == FB_THRIFT_TYPE_I64);
+ FB_API_TCHK(fb_thrift_read_i64(thft, NULL));
break;
}
}