Philipp Thomas wrote:
* Dominique Leuenberger (Dominique.Leuenberger@TMF-Group.com) [20081219 14:47]:
Which ends up to be in this loop:
for(t=1; t<of->m_nInstruments; t++) { // xmms modplug doesn't use slot zero if( (of->Headers[t] = new INSTRUMENTHEADER) == NULL ) return FALSE; memset(of->Headers[t], 0, sizeof(INSTRUMENTHEADER)); PATinst(of->Headers[t], t, pat_smptogm(t)); }
I'd try
memset(of->Headers[t], 0, sizeof(of->Headers[t]);
Philipp
Actually the memset line looks correct. The above won't work because of->Headers[t] is a pointer, the size of which is going to be 4bytes on most platforms, as you can tell from it being assigned from the new command. That is probably not what the author intended. If you look at the output in the original posting you see: ########## In function 'char* strncpy(char*, const char*, size_t)', inlined from 'void PATinst(INSTRUMENTHEADER*, int, int)' at load_pat.cpp:1147, inlined from 'BOOL PAT_Load_Instruments(void*)' at load_pat.cpp:1321: /usr/include/bits/string3.h:122: warning: call to char* __builtin___strncpy_chk(char*, const char*, unsigned int, unsigned int) will always overflow destinat ion buffer ########### This looks to me like the overflow is happening somewhere in the code of PATinst(of->Headers[t], t, pat_smptogm(t)); which we can't see from his posting. -- kr -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org