diff options
author | phintuka <phintuka> | 2006-09-20 05:47:52 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2006-09-20 05:47:52 +0000 |
commit | 68bdd9a5636123e53c70cf15d3f0ed016899331b (patch) | |
tree | b22400a61ecf67348493687c8e998669ca1ffff3 | |
parent | 1d306c2e5cd40d64731ba3574efea114b42374fc (diff) | |
download | xineliboutput-68bdd9a5636123e53c70cf15d3f0ed016899331b.tar.gz xineliboutput-68bdd9a5636123e53c70cf15d3f0ed016899331b.tar.bz2 |
Buffer size check
-rw-r--r-- | frontend_local.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/frontend_local.c b/frontend_local.c index 9594caea..c3e523ed 100644 --- a/frontend_local.c +++ b/frontend_local.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_local.c,v 1.10 2006-09-19 04:18:55 phintuka Exp $ + * $Id: frontend_local.c,v 1.11 2006-09-20 05:47:52 phintuka Exp $ * */ @@ -203,8 +203,9 @@ int cXinelibLocal::Xine_Control(const char *cmd) { TRACEF("cXinelibLocal::Xine_Control"); if(cmd && *cmd) { - char buf[2048]; - sprintf(buf, "%s\r\n", cmd); + char buf[4096]; + snprintf(buf, sizeof(buf), "%s\r\n", cmd); + buf[sizeof(buf)-1] = 0; LOCK_FE; if(fe) return fe->xine_control(fe, (char*)buf); |