#257 Sketch nurb curves bug found

crash or data loss

I have earlier reported problems with nurb curves in sketches in tracker #2990066. I have now found the position in the code where the bug appears.
In function rt_sketch_export5() in the file sketch.c no space is allocated for the magic number for nurb curves , so SIZEOF_NETWORK_LONG more bytes should be allocated in this case.

ep->ext_nbytes += 3 * SIZEOF_NETWORK_LONG; /* order, pt_type, c_size */

should be

ep->ext_nbytes += 4 * SIZEOF_NETWORK_LONG; /* magic, order, pt_type, c_size */

I my case 256 bytes were allocated for the sketch, but 260 bytes were written, corrupting the heap.

Östen Lundahl


  • Sean Morrison

    Sean Morrison - 2010-05-26

    This issue has been resolved in the latest (unreleased) version of the source code. Thank you for bringing the issue to our attention! You're welcome and encouraged to test and make sure this issue is resolved after the next source release of BRL-CAD.

  • Sean Morrison

    Sean Morrison - 2010-05-26
    • labels: --> Geometry Editing
    • milestone: --> crash or data loss
    • priority: 5 --> 8
    • assigned_to: nobody --> brlcad
    • status: open --> closed-fixed
  • Sean Morrison

    Sean Morrison - 2010-05-26

    Wow, Östen, that is great detective work on finding a pretty obscure bug.. Excellent work! I've applied a fix to our latest build and credited you in our release notes. The fix was applied as of r39474 and should be in the upcoming 7.16.10 release.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks