diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-01-09 22:53:08 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-01-09 22:53:08 +0000 |
commit | 6208ade4ecd6bd6282ed0a549e1dabf938b973d8 (patch) | |
tree | 7a63474ddcb89d07f98b9fc51a0af8d6ddffc9c9 | |
parent | c02256b2b1cfe165e76da9f307887bb35c968735 (diff) | |
parent | 2a9d1fe9f99cc2329a762f6e30a8ee0dc8e84014 (diff) | |
download | xine-lib-6208ade4ecd6bd6282ed0a549e1dabf938b973d8.tar.gz xine-lib-6208ade4ecd6bd6282ed0a549e1dabf938b973d8.tar.bz2 |
Merge from 1.1.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/strtok_r.c | 8 |
2 files changed, 8 insertions, 4 deletions
@@ -53,6 +53,10 @@ xine-lib (1.1.90) (Unreleased) * Check for supported extensions before opening the plugin and remove redundant core from plugins. +xine-lib (1.1.9.1) (unreleased) + * Fix a read-past-end bug in xine-lib's internal strtok_r replacement. + (Only affects systems without strtok_r.) + xine-lib (1.1.9) * Fix dvd://.../title[.chapter] handling (somewhat broken in 1.1.8). * Fix switching DVB subtitles channels. diff --git a/lib/strtok_r.c b/lib/strtok_r.c index cead029a2..8a5284a42 100644 --- a/lib/strtok_r.c +++ b/lib/strtok_r.c @@ -19,7 +19,7 @@ char *xine_private_strtok_r(char *s, const char *delim, char **ptrptr) { else s = *ptrptr; /* end of searching */ - if (!s || s == '\0') return NULL; + if (!s || !*s) return NULL; /* cut the initial garbage */ cutlen = strspn(s, delim); @@ -32,12 +32,12 @@ char *xine_private_strtok_r(char *s, const char *delim, char **ptrptr) { } next = s + toklen; + /* prepare next call */ + *ptrptr = *next ? next + 1 : NULL; + /* cut current token */ *next = '\0'; - /* prepare next call */ - *ptrptr = next + 1; - /* return the token */ return s; } |