[H-GEN] Linux related work in Bris vegas?

Ben Martin monkeyiq at users.sourceforge.net
Mon Aug 26 23:32:50 EDT 2002


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

On Tue, 2002-08-27 at 13:10, Robert Brockway wrote:
> [ Humbug *General* list - semi-serious discussions about Humbug and     ]
> [ Unix-related topics. Posts from non-subscribed addresses will vanish. ]
> 
> On Tue, 27 Aug 2002, Andrae Muys wrote:
> 
> > Ok, now I'm confused.  Could some kind soul please explain to me how you
> > can have a const char* on the stack?  I don't think I've ever seen a
> > constant stack segment before... A POP-only stack, interesting concept ;).
> 
> It's a really bad random number generator isn't it? :)

well, depending on how historic your compiler is 

const char* timeBomb = "some nice string that works most the time";

// not in any particular location or function
char* x = <from someplace>;
strcpy( timeBomb, x );

and you cross your fingers that strlen(x) < strlen( timeBomb ) or put a
4K string after timeBomb on the stack and hope things work 'as
expected'. Its a shame that the compiler didn't hit them over the head
with a cluebat, but then again I'd have never seen the interesting
example then.

-- 
-----------------------------------------------------
I'm not a pointer but I play one on the TV.
http://witme.sourceforge.net/libferris.web/


--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list