Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFcccc
int si1, si2, = /* initialized using untrusted data */;
int si2 = /* initialized using untrusted data */;
int sresult;

unsigned int ui1, ui2, = /* initialized using untrusted data */;
unsigned int ui2 = /* initialized using untrusted data */;
unsigned int uresult;

sresult = si1 >> si2;
uresult = ui1 >> ui2;

...

Code Block
bgColorccccff
unsigned int ui1, ui2, result = /* initialized using untrusted data */;
unsigned int ui2 = /* initialized using untrusted data */;
unsigned int uresult;

if (ui2 >= sizeof(unsigned int) * CHAR_BIT) {
  /* handle error condition */
}
else {
  uresult = ui1 >> ui2;
}

...