• unknown's avatar
    Bug #27119 server crash with integer division by zero during filesort on huge result · 3770083b
    unknown authored
    Added checks to detect integer overflow and fixed other bugs on the error path.
    
    
    myisam/sort.c:
      Replaced a break statement with a goto statement so that a failure will instead break
    sql/filesort.cc:
      Fixed an allocation routine to detect integer overflow, and as an optimization a check that prevents the number of buffpeks being larger than can possibly fit into memory.
          
      Fixed several unchecked error codes.
          
      Changed an index variable from int to uint to the match the type of the variable it's
      being compared with.
          
          Replaced a break statement with a goto statement so that a failure will instead break
      out of the higher level while-loop, instead of just the nested for-loop.
    3770083b
sort.c 31.4 KB