Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Negative Character Value  at pvmcruft.c:649

Categories: MISC.NEGCHAR CWE:119 CWE:686
Warning ID: 6.28578
Similar Warnings: 6.28579
Procedure: pvmxtoi
Trace: view
Modified: Thu Nov 26 11:26:13 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /kat0/fletcher/SATE/2010/pvm3/src/pvmcruft.c
   Enter pvmxtoi
 639  
 640 pvmxtoi(p) 
 641         char *p;
 642 {
 643         int i = 0;
 644         char c;
 645  
 646         if (p[0] == '0' && (p[1] == 'x' || p[1] == 'X'))   /* Uninitialized Variable (ID: 130.28751) */  /* 5 more... */
 647                 p += 2;
 648         while (isxdigit(c = *p++)) {   /* Negative Character Value (ID: 5.28577) */
Type is char or signed char649                 i = (i << 4) + c - (isdigit(c) ? '0' : (isupper(c) ? 'A' : 'a') - 10);     /* Negative Character Value */
 650         }
 651         return i;
 652 } 
 653  
 654  
 655 /*      pvmstrtoi()
 656  *
 657  *      Convert string in decimal, hex or octal to integer.
 658  */ 
 659  




Change Warning 6.28578 : Negative Character Value

Because they are very similar, this warning shares annotations with warning 6.28579.

Priority:
State:
Finding:
Owner:
Note: