From 7b47f12f8f1cae385060741e4e7f758297515225 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 23 Nov 2014 13:40:52 +0100 Subject: client API: restrict client names Use a fixed size array for the client name, which also limits the client name in size. Sanitize the client name string, and replace characters that are not in [A-Za-z0-9] with '_'. --- player/client.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/client.h') diff --git a/player/client.h b/player/client.h index 14822504c9..bdecae20ae 100644 --- a/player/client.h +++ b/player/client.h @@ -11,6 +11,9 @@ struct mpv_handle; struct mp_client_api; struct mp_log; +// Includes space for \0 +#define MAX_CLIENT_NAME 64 + void mp_clients_init(struct MPContext *mpctx); void mp_clients_destroy(struct MPContext *mpctx); int mp_clients_num(struct MPContext *mpctx); -- cgit v1.2.3