Date: Wed, 23 Apr 2008 18:26:35 +0200 From: Roman Divacky <rdivacky@freebsd.org> To: Mike Meyer <mwm@mired.org> Cc: hackers@freebsd.org, Garrett Cooper <yanefbsd@gmail.com>, Mike Meyer <mwm-keyword-freebsdhackers2.e313df@mired.org> Subject: Re: strdup(NULL) supposed to create SIGSEGV? Message-ID: <20080423162635.GA42593@freebsd.org> In-Reply-To: <20080423113951.020f0130@mbook-fbsd> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> <20080423113951.020f0130@mbook-fbsd>
next in thread | previous in thread | raw e-mail | index | archive | help
> I think someone gave the reason I'm about to: trying to copy a NULL > pointer means I have a bug somewhere earlier in my code that will > eventually produce visibly wrong results - a segfault being such. The > sooner that happens after the bug, the less code I have to search to > find it, the better for me. if only the fix was something else than if (ptr != NULL) strdup(ptr); :)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080423162635.GA42593>