]> git.sesse.net Git - vlc/commit
ConfigLoadString loses the last character of strings
authorMario Speiß <1034-135@online.de>
Fri, 18 Jan 2013 22:52:36 +0000 (23:52 +0100)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 19 Jan 2013 08:27:24 +0000 (10:27 +0200)
commita63f061bc42d7c472ba72a5e3feacc0751d4d072
tree62a31c034f5da7af21eed5bd688fe7740ac5ee16
parenta2d768f7247887f30183556065d1d577f3f130c4
ConfigLoadString loses the last character of strings

ConfigLoadString allocates memory for 'size' bytes and copys a NULL terminated
string to this buffer.
ConfigSaveString instead expects the buffer to be NULL terminated but:
 - the 'size' saved to the cache is the char count
 - the string is written without terminating NULL.

So obviously ConfigLoadString does not match the behaviour of ConfigSaveString.
It seems to me that the cached module configuration is not working at all due
to comparing the module file names within CacheFind - this should never have
found a match.

I think this would need some more testing.

Regards,
Mario

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
src/modules/cache.c