skipping read_socket_from_raw if invalid syntax was sent

This commit is contained in:
Václav Šmejkal 2023-03-31 18:09:35 +02:00
parent af03d64699
commit e0e82d2570
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -220,6 +220,8 @@ char *read_socket_from_raw(char *raw)
char *final_message;
struct json_object *json_obj = json_tokener_parse(raw);
if (json_obj == NULL) return "ERR"; //RETURN IF INVALID SYNTAX WAS SENT BY SOME FUCKING SCRIPT KIDDIE
//GET STRINGS
char *message = get_string_from_json(json_obj, "message"); //TODO: Check deallocation problems
char *username = get_string_from_json(json_obj, "username");