Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-808

Segfault when constant declaration references a struct field that doesn't exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.4
    • None
    • None
    • Patch Available

    Description

      When attempting to generate code for a Thrift file like:

      struct X {
        required string my_field;
      }
      
      const X CONSTANT_X = {
        'my_field_1' : 'blah'
      }
      
      

      I find that I get a segfault. GDB tracks it back to line 99 of t_scope.h, where it looks like we try to get a t_field object from the parent struct by name, and then ultimately don't check if we actually got back something valid or not.

      Attachments

        1. thrift-808.patch
          0.8 kB
          Bryan Duxbury

        Activity

          People

            bryanduxbury Bryan Duxbury
            bryanduxbury Bryan Duxbury
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: