Crash at the nth hour

Now, here is what happened yesterday.

A POC is scheduled for next day morning. Since its a big customer everyone is looking forward for it. POC preparations are underway when I get a call at 9.30pm that there is a crash. We have a reg-ex capabilities on the application data on the fly, as an when the message is parsed through our box.

We were using a standard posix regex engine. No brainer there..however what I left behind was a simple Null check.

This post is to remind myself as a good programmer that even when assumptions are that the string can never be null, go ahead and make a check on Null’ness of the string. Especially when passing it to standard libc libraries (strcpy/regcomp etc).

And if you don’t, what will be the end result? Crash at the nth hour..Fixes, Patches, unnecessary late nights…


About this entry