Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
uuid: check the uuid string size
  • Loading branch information
perexg committed Aug 18, 2014
1 parent 4dc8789 commit 4a13a2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/uuid.c
Expand Up @@ -107,6 +107,10 @@ uuid_init_bin ( tvh_uuid_t *u, const char *str )
{
memset(u, 0, sizeof(tvh_uuid_t));
if (str) {
if (strlen(str) != UUID_HEX_SIZE - 1) {
tvherror("uuid", "wrong uuid size");
exit(1);
}

This comment has been minimized.

Copy link
@ksooo

ksooo Aug 20, 2014

Contributor

@perexg For some strange reason I run into this exit on every tvh startup. Any idea how to debug this (without gdb, just with meanungful logs/traces)?

This comment has been minimized.

Copy link
@SebastianBrings

SebastianBrings Aug 20, 2014

Same here. I modified the code to print out offending size and string and to continue:
2014-08-20 18:30:02.326 [ INFO] linuxdvb: adapter added /dev/dvb/adapter1
2014-08-20 18:30:02.413 [ INFO] linuxdvb: adapter added /dev/dvb/adapter0
2014-08-20 18:30:02.449 [ ERROR] uuid: wrong uuid size 1 for 2
2014-08-20 18:30:02.452 [ ERROR] uuid: wrong uuid size 1 for 1
2014-08-20 18:30:02.456 [ INFO] CSA: Using 32bit parallel descrambling
2014-08-20 18:30:02.456 [ INFO] epggrab: module eit created

so the strings which it complains about are "1" and "2".

This comment has been minimized.

Copy link
@perexg

perexg Aug 20, 2014

Author Contributor

You have old files in your configuration directory. In 6cbf156 (v3.9-1341-g6cbf156) I added more log messages to identify the exact directory. Look for files '1', '2' ...

This comment has been minimized.

Copy link
@ksooo

ksooo Aug 20, 2014

Contributor

Hmm. Had a file named '1' in directory 'accesscontrol'. Shouldn't those 'old' files be automatically migrated by tvh instaed of causing an abort?

This comment has been minimized.

Copy link
@perexg

perexg Aug 20, 2014

Author Contributor

Yes, but you probably used an older version of tvh after new version which created old files again. The conversion is done only once.

This comment has been minimized.

Copy link
@ksooo

ksooo Aug 20, 2014

Contributor

Ahh, I see. Could be the case indeed. Thanks for clarifying.

BTW: I have to directories, one named 'channel' the other named 'channels'. Is one of these directories obsolete and can be deleted? If yes, which one?

This comment has been minimized.

Copy link
@perexg

perexg Aug 20, 2014

Author Contributor

The 'channel' dir is correct for latest tvh...

return hex2bin(u->bin, sizeof(u->bin), str);
} else if (read(fd, u->bin, sizeof(u->bin)) != sizeof(u->bin)) {
tvherror("uuid", "failed to read from %s", RANDOM_PATH);
Expand Down

0 comments on commit 4a13a2b

Please sign in to comment.