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

Fix stack overflow in framed transport

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.13.0
    • 0.14.0
    • C glib - Library
    • Patch

    Description

      Alloca() allocates memory on the stack. A stack overflow exception is generated if the space cannot be allocated.
      Use g_new0 instead of g_alloca.
      =================================================================
      ==test_server==130665==ERROR: AddressSanitizer: stack-overflow on address 0x7ffbfe573e98 (pc 0x7f0b0e309147 bp 0x7ffc11174000 sp 0x7ffbfe573ea0 T0)
      #0 0x7f0b0e309146 in thrift_framed_transport_flush src/thrift/c_glib/transport/thrift_framed_transport.c:235
      #1 0x7f0b0e2fe874 in thrift_transport_flush src/thrift/c_glib/transport/thrift_transport.c:85
      #2 0x4299ab in t_test_thrift_test_processor_process_test_string gen-c_glib/t_test_thrift_test.c:5170
      #3 0x434266 in t_test_thrift_test_processor_dispatch_call gen-c_glib/t_test_thrift_test.c:7179
      #4 0x7f0b0e2e82f0 in thrift_dispatch_processor_process src/thrift/c_glib/processor/thrift_dispatch_processor.c:56
      #5 0x7f0b0e30c7d2 in thrift_simple_server_serve src/thrift/c_glib/server/thrift_simple_server.c:58
      #6 0x7f0b0e30b65b in thrift_server_serve src/thrift/c_glib/server/thrift_server.c:108
      #7 0x40946c in main src/test_server.c:280
      #8 0x7f0b0ce28872 in __libc_start_main (/usr/lib64/libc.so.6+0x23872)
      #9 0x404a6d in _start (/mnt/hgfs/share/thrift-0.13.0/test/c_glib/.libs/test_server+0x404a6d)

      SUMMARY: AddressSanitizer: stack-overflow src/thrift/c_glib/transport/thrift_framed_transport.c:235 in thrift_framed_transport_flush
      ==test_server==130665==ABORTING

      Attachments

        Issue Links

          Activity

            People

              wangyunjian wangyunjian
              wangyunjian wangyunjian
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m