mirror of
https://github.com/swaywm/sway.git
synced 2026-04-24 06:46:22 -04:00
swaymsg: set limit for max JSON depth
This commit is contained in:
parent
db70f6496c
commit
66b318bb71
1 changed files with 2 additions and 3 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
#define _POSIX_C_SOURCE 200809L
|
#define _POSIX_C_SOURCE 200809L
|
||||||
#include <limits.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -481,7 +480,7 @@ int main(int argc, char **argv) {
|
||||||
char *resp = ipc_single_command(socketfd, type, command, &len);
|
char *resp = ipc_single_command(socketfd, type, command, &len);
|
||||||
|
|
||||||
// pretty print the json
|
// pretty print the json
|
||||||
json_tokener *tok = json_tokener_new_ex(INT_MAX);
|
json_tokener *tok = json_tokener_new_ex(1024);
|
||||||
json_object *obj = json_tokener_parse_ex(tok, resp, -1);
|
json_object *obj = json_tokener_parse_ex(tok, resp, -1);
|
||||||
enum json_tokener_error err = json_tokener_get_error(tok);
|
enum json_tokener_error err = json_tokener_get_error(tok);
|
||||||
json_tokener_free(tok);
|
json_tokener_free(tok);
|
||||||
|
|
@ -520,7 +519,7 @@ int main(int argc, char **argv) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
json_tokener *tok = json_tokener_new_ex(INT_MAX);
|
json_tokener *tok = json_tokener_new_ex(1024);
|
||||||
json_object *obj = json_tokener_parse_ex(tok, reply->payload, -1);
|
json_object *obj = json_tokener_parse_ex(tok, reply->payload, -1);
|
||||||
enum json_tokener_error err = json_tokener_get_error(tok);
|
enum json_tokener_error err = json_tokener_get_error(tok);
|
||||||
json_tokener_free(tok);
|
json_tokener_free(tok);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue