I read a tag list from a binary packet stored in a CMemFile object.
Writing the same taglist to another MemFile, the binary output is different from the original binary input.
To reproduce the bug, simply put the attached cpp file in src dir, and add
#include "amule_taglist_selftest.cpp"
somewhere at the bottom of amule.cpp.
The attached source file contains two taglist dump captured directly from a live kad session.
IMHO, some sort of self-test could be added to amule startup.