From 9174cb1fa3ed7814d7d3ae2b740bf149d1297ce8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 14 Jan 2020 21:22:47 +0100 Subject: [PATCH] netfile: fix posible segfalt with chunked mode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d3048364984debdc83cd427cb8efe54e9a915a15 Author: Jacek Jendrzej Date: 2020-01-14 (Tue, 14 Jan 2020) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/netfile.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index ec0a3dc94..d6f47d86f 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -1771,11 +1771,14 @@ void CacheFillThread(void *c) char ch = buf[0]; if(ch > 0) { + size_t icybufsize = 256*16+1; + char icybuf[icybufsize]; + memset(icybuf,0, icybufsize); int len = (ch * 16); - memset(buf,0, meta_interval); - rval = http_read_stream_all(scache->fd, buf,len ); + fprintf(stderr,"##### len %i meta_interval %i chunkSize %i\n",len,meta_interval,chunkSize); + rval = http_read_stream_all(scache->fd, icybuf,len ); chunkSize -= rval; - ShoutCAST_ParseMetaData(buf, scache->filter_arg->state); + ShoutCAST_ParseMetaData(icybuf, scache->filter_arg->state); if(scache->filter_arg->state->cb) scache->filter_arg->state->cb(scache->filter_arg->state); }