Ticket #1482: sectionreader_validation2.patch
File sectionreader_validation2.patch, 1023 bytes (added by , 18 years ago) |
---|
-
libs/libmythtv/dvbsiparser.cpp
293 293 294 294 int rsz = read(pollArray[i].fd, &buffer, MAX_SECTION_SIZE); 295 295 296 if (rsz > 0) 296 /* minimal valid DVB section is the TDT of size 8 297 validate the size of the buffer against the encoded section_length */ 298 if (rsz >= 8 && (rsz-3 == ((buffer[1] & 0x0f) << 8 | buffer[2]))) 297 299 { 298 300 ParseTable(buffer, rsz, 299 301 PIDfilterManager[pollArray[i].fd].pid); … … 301 303 continue; 302 304 } 303 305 306 if (rsz > 0) 307 { 308 processed = true; 309 continue; 310 } 311 304 312 if (rsz == -1 && errno == EAGAIN) 305 313 { 306 314 i--;