- TalkBack 9 of 33:
- Next »
- « Previous
- Thread View
- Flat View
- lint and char[256]
-
you know the old function calls
char *inputstring=(char *)malloc(2048);
scanf(INPUTSTREAM,"%s",inputstring);
how many times have you used the same kind of
code as the above. Note by default, you can
overrun program memory by there being a string on
INPUTSTREAM larger than 2048. If you hit the
stack, you can put a return address in there, put
code in the overflow, and next time a subroutine
finishes, you've got control.
When you write quick n dirty code, you do the
above. Later it gets missed. This is why memory
control isn't any good in the hands of most
programmers.
Memory leaks can be tested for by lint and so on,
but if you have a process running for a while,
how do you distinguish from heap that's being
allocated and heap that's been "lost".
I think there is some GNU stdlib which tracks
lost malloc'd memory and when a pointer which is
the last reference to a block is assigned to a
new value, the pointer assignment barfs. I think
the pointers probably have reference counters
built in, and are smart in some way.
Still, write it in java, and you know you havent
got the same problem! (note you can compile java
with gcj, which is just another face of gnuC). - Posted by: hipparchus2001 Posted on: 02/04/05 You are currently: a Guest | Members login | Terms of Use
What do you think?
SponsoredWhite Papers, Webcasts, and Downloads
- Three Steps You Need to Know to Stop Data Loss Varonis Sensitive data exposed to misuse or loss... it is the stuff of nightmares ... Download Now
- Why Isn't Server Virtualization Saving Us More? A Few Small Changes May Dramatically Increase Your Efficiency VMware Companies have rapidly adopted server virtualization over the past few ... Download Now
- Get top-ranked Novell support for Red Hat at 50% less Novell A simplified IT environment isn't just less complex, it's more reliable. ... Download Now
Premier Vendor Content Whitepapers, webcasts & resources from our Power Center Sponsors
- Reduce risk. Reduce complexity. Increase reliability.
-
A simplified IT environment isn't just less complex. It's also more reliable. Standardize on a single Linux platform with SUSE Linux Enterprise from Novell, and get the world's most interoperable Linux
- Learn more >>
- Keep Up With The Latest In Document Management with The DocuMentor.
-
Doc delivers the scoop on today's enterprise content management, printer maintenance, and all other issues related to document management. It's the DocuMentor Blog.
- Learn more >>
- Learn more about tools to grow your business
-
The Business Essentials Guide provides you useful tools and templates to help grow your business and save you time with automated shipping solutions.
- Save time with the UPS Business Essentials Guide
- Microsoft Dynamics CRM Online - Free Six-Month Trial for Eligible Organizations
-
Microsoft Dynamics CRM Online provides fast online access, simple contact management and better sales performance for a low monthly cost - the best value on the market today.

- Learn more about the free, six-month trial offer>>
SmartPlanet
- Thought-provoking progressive ideas on diverse topics that intersect with technology, business, and life, and matter to the world at large. Visit SmartPlanet
- More from IBM
- How to Drive Better Business Outcomes with Exceptional Web Experiences Download the eBook
- Driving Business Agility through SOA Connectivity & Integration Read the White Paper from IBM
- Linking Decisions and Information for Organizational Performance Read the Tom Davenport study






