diff options
author | Alex Deymo <deymo@chromium.org> | 2013-03-15 16:29:19 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-03-15 16:29:19 -0500 |
commit | e4968e7fda915d3c8d408b45c51d8f3614f213c5 (patch) | |
tree | 0b4770ff6e2d561f3c11a39bcf2118c9ad9d2862 /src | |
parent | ed881174ca207a712a7b3cb5d1e756253bacb974 (diff) | |
download | bluez-e4968e7fda915d3c8d408b45c51d8f3614f213c5.tar.gz |
textfile: Fix a pointer arithmetic logic bug in read_key()
A substraction of pointers ends up in a wrong computation of the size
passed to strnpbrk() in read_key(). This patch fixes the pointer logic.
Diffstat (limited to 'src')
-rw-r--r-- | src/textfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/textfile.c b/src/textfile.c index a4e54a4cd..7267f3a77 100644 --- a/src/textfile.c +++ b/src/textfile.c @@ -335,7 +335,7 @@ static char *read_key(const char *pathname, const char *key, int icase) goto unmap; } - end = strnpbrk(off, size - (map - off), "\r\n"); + end = strnpbrk(off, size - (off - map), "\r\n"); if (!end) { err = -EILSEQ; goto unmap; |