mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
netfile: paranoia checks to avoid out-of-bounds access
This commit is contained in:
committed by
Jacek Jendrzej
parent
b8aa68a2da
commit
256aacf33f
@@ -2,7 +2,7 @@
|
||||
| Neutrino-GUI - DBoxII-Project
|
||||
|
|
||||
| Copyright (C) 2004 by Sanaia <sanaia at freenet dot de>
|
||||
| Copyright (C) 2010-2012 Stefan Seyfried
|
||||
| Copyright (C) 2010-2013 Stefan Seyfried
|
||||
|
|
||||
| netfile - remote file access mapper
|
||||
|
|
||||
@@ -421,6 +421,9 @@ int request_file(URL *url)
|
||||
|
||||
if(meta_int)
|
||||
{
|
||||
if (slot < 0){
|
||||
dprintf(stderr, "error: meta_int != 0 && slot < 0");
|
||||
}else{
|
||||
/* hook in the filter function if there is meta */
|
||||
/* data present in the stream */
|
||||
cache[slot].filter_arg = ShoutCAST_InitFilter(meta_int);
|
||||
@@ -432,6 +435,7 @@ int request_file(URL *url)
|
||||
if(cache[slot].filter_arg->state)
|
||||
memmove(cache[slot].filter_arg->state, &tmp, sizeof(CSTATE));
|
||||
}
|
||||
}
|
||||
|
||||
/* push the created ID3 header into the stream cache */
|
||||
push(url->stream, (char*)&id3, id3.len);
|
||||
@@ -1673,6 +1677,8 @@ int f_status(FILE *stream, void (*cb)(void*))
|
||||
|
||||
/* lookup the stream ID in the cache table */
|
||||
i = getCacheSlot(stream);
|
||||
if (i < 0)
|
||||
return -1;
|
||||
|
||||
if(cache[i].fd == stream)
|
||||
{
|
||||
|
Reference in New Issue
Block a user