Skip to content
  • Xing Zhang's avatar
    4582ddc6
    Bug#29585648: UBSAN NEGATION OF NEGATIVE IN MY_STRTOLL10_MB2 · 4582ddc6
    Xing Zhang authored
    Description: when the number is the minimum negative value of long long
    type, the ubsan build raises a runtime error.
    
    In my_strtoll10_mb2(), it uses one unsigned value to hold a negative
    number's abs value. If the number is the minimum negative value of long
    long type (-9223372036854775808), its abs value (9223372036854775808)
    exceeds the maximum positive value of long long type (9223372036854775807).
    
    Fix: return LLONG_MIN if its abs value equals the maximum positive value.
    
    Change-Id: I9a7a4df1596a586b1bfab2a3725a9a6998969be7
    4582ddc6
    Bug#29585648: UBSAN NEGATION OF NEGATIVE IN MY_STRTOLL10_MB2
    Xing Zhang authored
    Description: when the number is the minimum negative value of long long
    type, the ubsan build raises a runtime error.
    
    In my_strtoll10_mb2(), it uses one unsigned value to hold a negative
    number's abs value. If the number is the minimum negative value of long
    long type (-9223372036854775808), its abs value (9223372036854775808)
    exceeds the maximum positive value of long long type (9223372036854775807).
    
    Fix: return LLONG_MIN if its abs value equals the maximum positive value.
    
    Change-Id: I9a7a4df1596a586b1bfab2a3725a9a6998969be7
Loading