Menu

#276 ProcessProbe::BuildProcessItem, local var 'position ' should be size_t type

Version 5.10
closed-fixed
nobody
None
5
2015-03-12
2015-03-12
unicode
No

For windows 64, process_probe

void ProcessProbe::BuildProcessItem ( PROCESSENTRY32 processEntry ) {
HANDLE openProcessHandle = OpenProcess ( PROCESS_ALL_ACCESS, false, processEntry.th32ProcessID );

if ( openProcessHandle != NULL ) {
    StringStringMultiMap::iterator it;
    string commandLineStr = "";
    string deviceProcessImageNameStr = "";
    LPTSTR deviceProcessImageName = ( LPTSTR ) malloc ( sizeof ( TCHAR ) * MAX_PATH );
    unsigned int position = 0;
    ...

should be "size_t position", if not,
if ( ( position = deviceProcessImageNameStr.find ( iterator->first ) ) != string::npos )
will be false forever

Discussion

  • unicode

    unicode - 2015-03-12

    sorry, be true forever. even not found, the following code will be executed still.

     
  • Michael Chisholm

    Fixed in r1802

     
  • Michael Chisholm

    • status: open --> closed-fixed
     

Log in to post a comment.