• Marc Alff's avatar
    Bug#51738 Unit test pfs_instr-t crashes · 7ceb3b42
    Marc Alff authored
    The unit test pfs_instr-t:
    - generates a very long (10,000) bytes file name
    - calls find_or_create_file.
    
    This leads to a buffer overflow in mysys in my_realpath(),
    because my_realpath and mysys file APIs in general do not
    test for input parameters: mysys assumes every file name
    is less that FN_REFLEN in length.
    
    Calling find_or_create_file with a very long file name is likely
    to happen when instrumenting third party code that does not use mysys,
    so this test is legitimate.
    
    The fix is to make find_or_create_file in the performance schema
    more robust in this case.
    7ceb3b42
pfs_instr.cc 26.3 KB