diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-02 12:52:37 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-09-02 12:52:37 +0200 |
commit | 13b74854b37a3a0f855ee8bf723ee3d9a2c360a5 (patch) | |
tree | a9e82c8123728bb689755ded8b7ca50e79e6f5a4 | |
parent | c95ee7d36775c03f26489a384b3a2733d9f5c8fc (diff) | |
download | vdr-13b74854b37a3a0f855ee8bf723ee3d9a2c360a5.tar.gz vdr-13b74854b37a3a0f855ee8bf723ee3d9a2c360a5.tar.bz2 |
Made LIRC command parsing more robust
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | lirc.c | 7 |
3 files changed, 7 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 98a23c54..f090c00b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1387,6 +1387,7 @@ Roman Krenický <free-rtk@gmx.de> Ville Skyttä <ville.skytta@iki.fi> for reporting several compiler warnings in gcc 4.0 for including the optional user defined Make.config from the 'libsi' Makefile + for making LIRC command parsing more robust Steffen Beyer <cpunk@reactor.de> for fixing setting the colored button help after deleting a recording in case the next @@ -3762,3 +3762,4 @@ Video Disk Recorder Revision History - Updated the Swedish OSD texts (thanks to Tomas Prybil). - Updated the Slovenian OSD texts (thanks to Matjaz Thaler). - Updated the Danish OSD texts (thanks to Mogens Elneff). +- Made LIRC command parsing more robust (thanks to Ville Skyttä). @@ -6,7 +6,7 @@ * * LIRC support added by Carsten Koch <Carsten.Koch@icem.de> 2000-06-16. * - * $Id: lirc.c 1.12 2005/08/15 12:28:10 kls Exp $ + * $Id: lirc.c 1.13 2005/09/02 12:51:35 kls Exp $ */ #include "lirc.h" @@ -76,7 +76,10 @@ void cLircRemote::Action(void) if (ready && ret > 21) { int count; char KeyName[LIRC_KEY_BUF]; - sscanf(buf, "%*x %x %29s", &count, KeyName); // '29' in '%29s' is LIRC_KEY_BUF-1! + if (sscanf(buf, "%*x %x %29s", &count, KeyName) != 2) { // '29' in '%29s' is LIRC_KEY_BUF-1! + esyslog("ERROR: unparseable lirc command: %s", buf); + continue; + } if (count == 0) { if (strcmp(KeyName, LastKeyName) == 0 && FirstTime.Elapsed() < KEYPRESSDELAY) continue; // skip keys coming in too fast |