summaryrefslogtreecommitdiff
path: root/svdrp.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-11-06 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-11-06 18:00:00 +0100
commit812ab9018c7be7feb901eface4c6431b483ca9ec (patch)
tree2032a68f87246ee2453c54cf9fc969f1f1be2da0 /svdrp.c
parent99e3c093f404b55683a90e38bbe74e1f51c35316 (diff)
downloadvdr-patch-lnbsharing-812ab9018c7be7feb901eface4c6431b483ca9ec.tar.gz
vdr-patch-lnbsharing-812ab9018c7be7feb901eface4c6431b483ca9ec.tar.bz2
Version 1.3.36vdr-1.3.36
- Fixed a NULL pointer access with the cUnbufferedFile when a replay session runs all the way until the end of the recording (thanks to Joachim Wilke). - A menu is no longer automatically closed when a replay ends (reported by Marko Mäkelä). - Removed '\n' from several syslog() calls (reported by Sascha Volkenandt). - Fixed missing '&' in the SetAreas() example in PLUGINS.html (reported by Sascha Volkenandt). - Fixed a memory leak in cString::operator=() (reported by Sascha Volkenandt). - Updated the Dutch OSD texts (thanks to Maarten Wisse). - cReadLine now dynamically allocates its buffer, so that it can handle lines of any length. - Changed cConfig::Load() to use cReadLine instead of a fixed buffer (thanks to Andreas Mair for reporting a problem with extremely long summary fields in timers). - cSVDRP now dynamically allocates its command buffer in order to handle commands of any length. The MAXPARSEBUFFER macro is now obsolete and has been removed. If a plugin has used that macro, it should either define a buffer size of its own, or use cReadLine when reading files. - Fixed a race condition in the SPU decoder (thanks to Marco Schlüßler). - The EPG scan no longer disturbs players that have also set live PIDs (reported by Stefan Huelswitt). - Fixed setting the help key display in the Recordings menu in case of several layers of subdirectories. - Removed EPG bugfix #0, because it removed actually important data.
Diffstat (limited to 'svdrp.c')
-rw-r--r--svdrp.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/svdrp.c b/svdrp.c
index cc5df70..8e09d41 100644
--- a/svdrp.c
+++ b/svdrp.c
@@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection.
*
- * $Id: svdrp.c 1.82 2005/09/25 10:36:59 kls Exp $
+ * $Id: svdrp.c 1.83 2005/11/05 11:21:38 kls Exp $
*/
#include "svdrp.h"
@@ -361,6 +361,8 @@ cSVDRP::cSVDRP(int Port)
{
PUTEhandler = NULL;
numChars = 0;
+ length = BUFSIZ;
+ cmdLine = MALLOC(char, length);
message = NULL;
lastActivity = 0;
isyslog("SVDRP listening on port %d", Port);
@@ -370,6 +372,7 @@ cSVDRP::~cSVDRP()
{
Close();
free(message);
+ free(cmdLine);
}
void cSVDRP::Close(bool Timeout)
@@ -1442,6 +1445,11 @@ bool cSVDRP::Process(void)
// showtime!
Execute(cmdLine);
numChars = 0;
+ if (length > BUFSIZ) {
+ free(cmdLine); // let's not tie up too much memory
+ length = BUFSIZ;
+ cmdLine = MALLOC(char, length);
+ }
}
else if (c == 0x04 && numChars == 0) {
// end of file (only at beginning of line)
@@ -1455,15 +1463,14 @@ bool cSVDRP::Process(void)
else if (c <= 0x03 || c == 0x0D) {
// ignore control characters
}
- else if (numChars < sizeof(cmdLine) - 1) {
+ else {
+ if (numChars >= length - 1) {
+ length += BUFSIZ;
+ cmdLine = (char *)realloc(cmdLine, length);
+ }
cmdLine[numChars++] = c;
cmdLine[numChars] = 0;
}
- else {
- Reply(501, "Command line too long");
- esyslog("SVDRP: command line too long: '%s'", cmdLine);
- numChars = 0;
- }
lastActivity = time(NULL);
}
else if (r < 0) {