<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: How to check for a valid pointer?</title>
	<atom:link href="http://www.pschweitzer.fr/?feed=rss2&#038;p=12" rel="self" type="application/rss+xml" />
	<link>http://www.pschweitzer.fr/?p=12</link>
	<description>Various topics about programming</description>
	<pubDate>Fri, 24 May 2013 16:39:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: pschweitzer</title>
		<link>http://www.pschweitzer.fr/?p=12#comment-716</link>
		<dc:creator>pschweitzer</dc:creator>
		<pubDate>Mon, 07 Jun 2010 17:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.pschweitzer.fr/?p=12#comment-716</guid>
		<description>First, thanks for your comment :).
Then, main purpose of those findings is not to replace SEH. That aims to be a "soft" substitute to SEH. Indeed, on Linux system you've got no exception handling in C as you can find on Microsoft platforms. You can play with signals, jumps, but that's not really easy to handle. Furthermore having a "nice" exception handling system starts being really hard and heavy.
The solution I purpose here is a way to ensure some basic stuff for a lower cost. When writing that, I am thinking about trycatch library, that you can find here: http://llg.cubic.org/trycatch/.
Indeed, that is bit hackish, not complete, but that is, in my opinion, a good begin to get rid of some errors in a program.</description>
		<content:encoded><![CDATA[<p>First, thanks for your comment :).<br />
Then, main purpose of those findings is not to replace SEH. That aims to be a &#8220;soft&#8221; substitute to SEH. Indeed, on Linux system you&#8217;ve got no exception handling in C as you can find on Microsoft platforms. You can play with signals, jumps, but that&#8217;s not really easy to handle. Furthermore having a &#8220;nice&#8221; exception handling system starts being really hard and heavy.<br />
The solution I purpose here is a way to ensure some basic stuff for a lower cost. When writing that, I am thinking about trycatch library, that you can find here: <a href="http://llg.cubic.org/trycatch/" rel="nofollow">http://llg.cubic.org/trycatch/</a>.<br />
Indeed, that is bit hackish, not complete, but that is, in my opinion, a good begin to get rid of some errors in a program.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksey</title>
		<link>http://www.pschweitzer.fr/?p=12#comment-715</link>
		<dc:creator>Aleksey</dc:creator>
		<pubDate>Sun, 06 Jun 2010 20:24:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.pschweitzer.fr/?p=12#comment-715</guid>
		<description>Your findings are fun of course, however all of this looks like one big, heavy and fat hack. Same way we can make up quite a few hack-checks which would ensure validity of some random pointer, by e.g. checking it to be inside heap virtual addresses range, being inside usermode address range, etc.
But all of this is just a hack. The only possible correct way is to probe this pointer inside a SEH, and if you are getting this function pointer as a callback, always wrap a call to it in a SEH.
If your concern is that GCC doesn't provide SEH, then I'm afraid GCC is not the right tool. You can kick in the nail to the wood using microscope, but it's better to use hammer ;)</description>
		<content:encoded><![CDATA[<p>Your findings are fun of course, however all of this looks like one big, heavy and fat hack. Same way we can make up quite a few hack-checks which would ensure validity of some random pointer, by e.g. checking it to be inside heap virtual addresses range, being inside usermode address range, etc.<br />
But all of this is just a hack. The only possible correct way is to probe this pointer inside a SEH, and if you are getting this function pointer as a callback, always wrap a call to it in a SEH.<br />
If your concern is that GCC doesn&#8217;t provide SEH, then I&#8217;m afraid GCC is not the right tool. You can kick in the nail to the wood using microscope, but it&#8217;s better to use hammer <img src='http://www.pschweitzer.fr/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
