summaryrefslogtreecommitdiffstats
path: root/player/client.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-23 13:40:52 +0100
committerwm4 <wm4@nowhere>2014-11-23 15:13:34 +0100
commit7b47f12f8f1cae385060741e4e7f758297515225 (patch)
treef76fbb15c2d095a855c145bc7469ed0d87490d20 /player/client.h
parent9d91776d0d0a876ce4036044bb5fac9e6f6e1440 (diff)
downloadmpv-7b47f12f8f1cae385060741e4e7f758297515225.tar.bz2
mpv-7b47f12f8f1cae385060741e4e7f758297515225.tar.xz
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 '_'.
Diffstat (limited to 'player/client.h')
-rw-r--r--player/client.h3
1 files changed, 3 insertions, 0 deletions
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);