Revision: 56753
          http://sourceforge.net/p/brlcad/code/56753
Author:   brlcad
Date:     2013-08-12 18:54:59 +0000 (Mon, 12 Aug 2013)
Log Message:
-----------
some basic sanity checking, hunting a stack smash

Modified Paths:
--------------
    brlcad/trunk/src/librt/primitives/bot/bot.c

Modified: brlcad/trunk/src/librt/primitives/bot/bot.c
===================================================================
--- brlcad/trunk/src/librt/primitives/bot/bot.c 2013-08-12 18:53:41 UTC (rev 
56752)
+++ brlcad/trunk/src/librt/primitives/bot/bot.c 2013-08-12 18:54:59 UTC (rev 
56753)
@@ -352,8 +352,15 @@
 int
 rt_bot_shot(struct soltab *stp, struct xray *rp, struct application *ap, 
struct seg *seghead)
 {
-    struct bot_specific *bot = (struct bot_specific *)stp->st_specific;
+    struct bot_specific *bot;
 
+    if (UNLIKELY(!stp || !ap || !seghead))
+       return 0;
+
+    bot = (struct bot_specific *)stp->st_specific;
+    if (UNLIKELY(!bot))
+       return 0;
+
     if (bot->tie != NULL) {
        return bottie_shot_double(stp, rp, ap, seghead);
     } else if (bot->bot_flags & RT_BOT_USE_FLOATS) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to