projects
/
platform
/
upstream
/
v4l-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2515e4f
)
descriptors: be sure to not read past the buffer
author
Mauro Carvalho Chehab
<m.chehab@samsung.com>
Fri, 14 Feb 2014 04:22:25 +0000
(13:22 +0900)
committer
Mauro Carvalho Chehab
<m.chehab@samsung.com>
Sat, 15 Feb 2014 18:47:59 +0000
(
03:47
+0900)
The loop will read 2 bytes from ptr, to get descriptor type and
length. Be sure that those two bytes are available.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
lib/libdvbv5/descriptors.c
patch
|
blob
|
history
diff --git
a/lib/libdvbv5/descriptors.c
b/lib/libdvbv5/descriptors.c
index
46c3be9
..
92ebc54
100644
(file)
--- a/
lib/libdvbv5/descriptors.c
+++ b/
lib/libdvbv5/descriptors.c
@@
-99,7
+99,8
@@
void dvb_parse_descriptors(struct dvb_v5_fe_parms *parms, const uint8_t *buf,
const uint8_t *ptr = buf;
struct dvb_desc *current = NULL;
struct dvb_desc *last = NULL;
- while (ptr < buf + section_length) {
+
+ while (ptr + 2 < buf + section_length) {
unsigned desc_type = ptr[0];
int desc_len = ptr[1];
size_t size;