瀏覽代碼

Also drop too big messages in activitypub_request().

grunfink 2 周之前
父節點
當前提交
e7db1c7175
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      activitypub.c

+ 3 - 0
activitypub.c

@@ -82,6 +82,9 @@ int activitypub_request(snac *user, const char *url, xs_dict **data)
             NULL, NULL, 0, &status, &payload, &p_size, 0);
     }
 
+    if (p_size >= 100000)
+        return HTTP_STATUS_BAD_REQUEST;
+
     if (status == 0 || (status >= 500 && status <= 599)) {
         /* I found an instance running Misskey that returned
            500 on signed messages but returned the object