Text   |  XML   |  ReML   |   Visible Warnings:

Cast Alters Value  at strutil.c:459

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

hex_str_to_bytes

(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/strutil.c)expand/collapse
Show more  
 426  hex_str_to_bytes(const char *hex_str, GByteArray *bytes, gboolean force_separators) {
 427          guint8          val;
 428          const guchar    *p, *q, *r, *s, *punct;
 429          char            four_digits_first_half[3];
 430          char            four_digits_second_half[3];
 431          char            two_digits[3];
 432          char            one_digit[2];
 433   
 434          if (! hex_str || ! bytes) {
 435                  return FALSE;
 436          }
 437          g_byte_array_set_size(bytes, 0);
 438          p = (const guchar *)hex_str;
 439          while (*p) {
 440                  q = p+1;
 441                  r = p+2;
 442                  s = p+3;
 443   
 444                  if (*q && *r && *s
 445                      && isxdigit(*p) && isxdigit(*q) &&
 446                      isxdigit(*r) && isxdigit(*s)) {
 447                          four_digits_first_half[0] = *p;
 448                          four_digits_first_half[1] = *q;
 449                          four_digits_first_half[2] = '\0';
 450                          four_digits_second_half[0] = *r;
 451                          four_digits_second_half[1] = *s;
 452                          four_digits_second_half[2] = '\0';
 453   
 454                          /*
 455                           * Four or more hex digits in a row.
 456                           */
 457                          val = (guint8) strtoul(four_digits_first_half, NULL, 16);
 458                          g_byte_array_append(bytes, &val, 1);
 459                          val = (guint8) strtoul(four_digits_second_half, NULL, 16);
Show more  




Change Warning 1106.29765 : Cast Alters Value

Priority:
State:
Finding:
Owner:
Note: