Skip to main content

Table 3 Overflow condition for integer operations

From: ELAID: detecting integer-Overflow-to-Buffer-Overflow vulnerabilities by light-weight and accurate static analysis

Integer operation Sign Overflow condition
x+y <S,S> x+y[−2N−1,−2N−1]
  <U,U> x+y[0,−2N−1]
xy <S,S> xy[−2N−1,−2N−1]
  <U,U> xy[0,−2N−1]
x×y <S,S> x×y[−2N−1,−2N−1]
  <U,U> x×y[0,−2N−1]
x/y <S,S> (y=0)(x=−2N−1y=−1)
  <U,U> y=0
x<<y,x>>y <S,S> y[0,N−1]
  <U,U>