[vlc-commits] mmstu: add proper boundary checks
Rémi Denis-Courmont
git at videolan.org
Tue Nov 20 21:34:11 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 20 21:15:30 2018 +0200| [da4d817d41024d32580aeecb5cfc1acf6fe81dcc] | committer: Rémi Denis-Courmont
mmstu: add proper boundary checks
This removes nonsensical arithmetic with pointer representation.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=da4d817d41024d32580aeecb5cfc1acf6fe81dcc
---
modules/access/mms/mmstu.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
index 390eafed67..37e3a60926 100644
--- a/modules/access/mms/mmstu.c
+++ b/modules/access/mms/mmstu.c
@@ -595,9 +595,7 @@ static int MMSOpen( stream_t *p_access, vlc_url_t *p_url, int i_proto )
#define GETUTF16( fmt, size ) \
do \
{ \
- if( (UINT32_MAX == size) || \
- ((uintptr_t) p / sizeof(uint16_t) < size) || \
- ((UINTPTR_MAX - (uintptr_t) p_cmdend) / sizeof(uint16_t)) < size )\
+ if( (p_cmdend - p) / 2 < (size) ) \
{\
var_buffer_free( &buffer );\
MMSClose( p_access );\
More information about the vlc-commits
mailing list