malloc + 4??
From: Kevin Torr (kevintorr_at_hotmail.com)
Date: 04/04/04
- Next message: Martin Dickopp: "Re: Problem with malloc"
- Previous message: Chris Fogelklou: "Re: Problem with malloc"
- Next in thread: Joona I Palaste: "Re: malloc + 4??"
- Reply: Joona I Palaste: "Re: malloc + 4??"
- Reply: Chris Torek: "Re: malloc + 4??"
- Reply: Dan Pop: "Re: malloc + 4??"
- Maybe reply: Irrwahn Grausewitz: "Re: malloc + 4??"
- Maybe reply: Ben Pfaff: "Re: malloc + 4??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 5 Apr 2004 00:21:59 +1000
http://www.yep-mm.com/res/soCrypt.c
I have 2 malloc's in my program, and when I write the contents of them to
the screen or to a file, there aren addition 4 characters.
As far as I can tell, both the code to register the malloc and to write
information into the malloc is solid. Why then ismy program returning an
additional 4 characters?
register malloc 1:
line 192
register malloc 2:
line 214
write to malloc 1:
line 200 - 205
write to malloc 2:
line 221 - 225
display malloc 2:
line 157
write malloc 2:
line 251
Here's how you execute the program:
socrypt.exe /e :i input.txt :o output.txt :A keya.txt :B keyb.txt :k
keyout.txt
**note that the input, keya, and keyb files must exist or the program will
return an error code.
If you write a text string into the input.txt file, it will write the same
string into the output.txt file plus an addition 4 characters.
The 1024 char random 'masterkey' is also written out to the keyout.txt file
with an addition 4 characters.
Why is this happening? I'm totally baffled and have spent days trying to
figure this out.
- Next message: Martin Dickopp: "Re: Problem with malloc"
- Previous message: Chris Fogelklou: "Re: Problem with malloc"
- Next in thread: Joona I Palaste: "Re: malloc + 4??"
- Reply: Joona I Palaste: "Re: malloc + 4??"
- Reply: Chris Torek: "Re: malloc + 4??"
- Reply: Dan Pop: "Re: malloc + 4??"
- Maybe reply: Irrwahn Grausewitz: "Re: malloc + 4??"
- Maybe reply: Ben Pfaff: "Re: malloc + 4??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]