Dabei kam einiges in dieser Art zum Vorschein:
Code: Alles auswählen
==19941== Use of uninitialised value of size 8
==19941== at 0x43BF81: SIsectionEIT::parseDescriptors(char const*, unsigned, SIevent&) (SIsections.cpp:291)
==19941== by 0x43C0FF: SIsectionEIT::parse() (SIsections.cpp:321)
==19941== by 0x432875: SIsectionEIT::SIsectionEIT(unsigned, char*) (SIsections.hpp:475)
==19941== by 0x42067F: _ZL9eitThreadPv (sectionsd.cpp:7076)
==19941== by 0x568106F: start_thread (in /lib64/libpthread-2.9.so)
==19941== by 0x60E510C: clone (in /lib64/libc-2.9.so)
Code: Alles auswählen
diff --git a/tuxbox/neutrino/daemons/sectionsd/SIsections.cpp b/tuxbox/neutrino/daemons/sectionsd/SIsections.cpp
index 0bf720d..f6944c6 100644
--- a/tuxbox/neutrino/daemons/sectionsd/SIsections.cpp
+++ b/tuxbox/neutrino/daemons/sectionsd/SIsections.cpp
@@ -312,7 +312,7 @@ void SIsectionEIT::parse(void)
e.original_network_id = original_network_id();
e.transport_stream_id = transport_stream_id();
descriptors_loop_length = (evt->descriptors_loop_length_hi << 8) | evt->descriptors_loop_length_lo;
- parseDescriptors(((const char *)evt) + sizeof(struct eit_event), min((unsigned)(buffer + bufferLength - actPos), descriptors_loop_lengt
h), e);
+ parseDescriptors(((const char *)evt) + sizeof(struct eit_event), min((unsigned)(buffer + bufferLength - actPos - sizeof(struct eit_even
t)), descriptors_loop_length), e);
evts.insert(e);
actPos += sizeof(struct eit_event) + descriptors_loop_length;
}
Ich vermute, da wir ja parseDescriptors() den speicher ab der stelle (evt + sizeof eit_event) übergeben, müssen wir auch sizeof eit_event von der Länge abziehen.
Stimmt das?
Damit meckert valgrind zumindest nicht mehr rum...