Invalid memory operation in strscan/posex
Original Reporter info from Mantis: Joost
-
Reporter name: Joost van der Sluis
Original Reporter info from Mantis: Joost
- Reporter name: Joost van der Sluis
Description:
If posex is called, and the substring can't be found, valgrind gives the following result: (see test-provided program) the problem is in the strscan procedure (i386, assembly)
==21501== Invalid read of size 4 ==21501== at 0x806C548: SYSUTILS_STRSCAN$PCHAR$CHAR$$PCHAR (in /home/test/src/testleak) ==21501== by 0x806C7D7: SYSUTILS_STRPOS$PCHAR$PCHAR$$PCHAR (in /home/test/src/testleak) ==21501== by 0x805EEE1: STRUTILS_POSEX$ANSISTRING$ANSISTRING$LONGWORD$$LONGINT (in /home/test/src/testleak) ==21501== by 0x8048476: main (testleak.pp:10) ==21501== by 0x804832A: (within /home/test/src/testleak) ==21501== Address 0x1BA75640 is 24 bytes inside a block of size 25 alloc'd ==21501== at 0x1B8FE899: malloc (vg_replace_malloc.c:149) ==21501== by 0x805D838: CMEM_CGETMEM$LONGINT$$POINTER (in /home/test/src/testleak) ==21501== by 0x80572D8: SYSTEM_GETMEM$POINTER$LONGINT (in /home/test/src/testleak)
==21501== by 0x804D225: SYSTEM_NEWANSISTRING$LONGINT$$POINTER (in /home/test/src/testleak) ==21501== by 0x804D6F8: fpc_ansistr_setlength (in /home/test/src/testleak) ==21501== by 0x804D462: fpc_shortstr_to_ansistr (in /home/test/src/testleak) ==21501== by 0x8048439: main (testleak.pp:10)
==21501== by 0x804832A: (within /home/test/src/testleak)
Additional information:
Reporter: Joost van der Sluis
EMail: joost - at - cnoc dot nl
Mantis conversion info:
- Mantis ID: 6314
- OS: Linux