Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Negative Character Value  at pvmcruft.c:649

Categories: LANG.TYPE.NEGCHAR CWE:119 CWE:686
Warning ID: 2415.2431
Similar Warnings: 2415.2430
Procedure: pvmxtoi
Trace: View
Modified: Wed Sep 2 12:37:18 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
   /u1/paul/SATE/2010/c/pvm/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'))   /* Null Pointer Dereference (ID: 2740.2795) */  /* 5 more... */
 647                 p += 2;
 648         while (isxdigit(c = *p++)) {   /* Negative Character Value (ID: 2414.2429) */
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 2415.2431 : Negative Character Value

Because they are very similar, this warning shares annotations with warning 2415.2430.
CodeSonar has selected warning 2415.2430 to represent this group of similar warnings. In order to edit this group, you must edit warning 2415.2430.