mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed a possible crash in parsing incorrect lines in 'channels.conf'
This commit is contained in:
parent
bd48a49712
commit
90dc8426db
1
HISTORY
1
HISTORY
@ -562,3 +562,4 @@ Video Disk Recorder Revision History
|
|||||||
- Displaying the frame counter in the replay progress display only when editing
|
- Displaying the frame counter in the replay progress display only when editing
|
||||||
a mark.
|
a mark.
|
||||||
- Fixed handling characters above 0xEF in SVDRP.
|
- Fixed handling characters above 0xEF in SVDRP.
|
||||||
|
- Fixed a possible crash in parsing incorrect lines in 'channels.conf'.
|
||||||
|
6
config.c
6
config.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.c 1.48 2001/06/23 14:01:03 kls Exp $
|
* $Id: config.c 1.49 2001/07/22 14:15:25 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -260,6 +260,7 @@ bool cChannel::Parse(const char *s)
|
|||||||
int fields = sscanf(s, "%a[^:]:%d:%c:%d:%d:%d:%a[^:]:%d:%d:%d", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apidbuf, &tpid, &ca, &pnr);
|
int fields = sscanf(s, "%a[^:]:%d:%c:%d:%d:%d:%a[^:]:%d:%d:%d", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apidbuf, &tpid, &ca, &pnr);
|
||||||
apid1 = apid2 = 0;
|
apid1 = apid2 = 0;
|
||||||
dpid1 = dpid2 = 0;
|
dpid1 = dpid2 = 0;
|
||||||
|
if (apidbuf) {
|
||||||
char *p = strchr(apidbuf, ';');
|
char *p = strchr(apidbuf, ';');
|
||||||
if (p)
|
if (p)
|
||||||
*p++ = 0;
|
*p++ = 0;
|
||||||
@ -267,6 +268,9 @@ bool cChannel::Parse(const char *s)
|
|||||||
if (p)
|
if (p)
|
||||||
sscanf(p, "%d,%d", &dpid1, &dpid2);
|
sscanf(p, "%d,%d", &dpid1, &dpid2);
|
||||||
delete apidbuf;
|
delete apidbuf;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
if (fields >= 9) {
|
if (fields >= 9) {
|
||||||
if (fields == 9) {
|
if (fields == 9) {
|
||||||
// allow reading of old format
|
// allow reading of old format
|
||||||
|
Loading…
Reference in New Issue
Block a user