Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!haven.umd.edu!wam.umd.edu!dmb From: dmb@wam.umd.edu (David M. Baggett) Newsgroups: comp.sys.atari.st.tech Subject: Re: Problem with my C program [a few general hints about malloc] Message-ID: <1991Apr30.143152.4465@wam.umd.edu> Date: 30 Apr 91 14:31:52 GMT References: <1991Apr23.144225.6273@wam.umd.edu> <2941.04.91@drdhh.hanse.de> Sender: usenet@wam.umd.edu (USENET Posting) Organization: CERT Lines: 33 In article <2941.04.91@drdhh.hanse.de> bjoern@drdhh.hanse.de (Bjoern Kriews) writes: >From dmb@wam.umd.edu (David M. Baggett): >> Oops, looks like someone broke into my account and posted something stupid! > >Oops, looks like someone did it once again .-) > >> calloc((unsigned) (bigsize / 32), 32); > >Just think about bigsize == 320002... Would you believe it? TWO forged messages in a row! The audacity of it! And right after I changed my password to something no one would guess: "password". (Oops! Now everyone knows!) What the loser who posted that MEANT was: #define CHUNK 32 /* or 64, 128, or whatever */ calloc((unsigned) (bigsize / CHUNK + 1), CHUNK); You see here what the intruder was feebly trying to get at about "space wastage" -- you get a few extra unused bytes at the end. Of course, that's better than writing a few extra bytes _past_ the end, which is what I think you were trying to get at with your picture. :-) I hope whoever broke into my account saw your reply! BIFF uh, I mean Dave Baggett dmb%wam.umd.edu@uunet.uu.net