Error C4703: Potentially uninitialized local pointer variable 'pNamesPtr' is used

I am working on a crypter project and when I try to compile a program, I encountered the following error.

main.cpp (520): error C4703: potentially uninitialized local pointer variable 'pNamesPtr' used
========== Build: 0 succeeded, 1 failed, 0 updated, 0 skipped ======= ===

        DLLNAMES[i].UsedAlready = 0;
    }


    *dwOutSize = (DWORD)pNamesPtr - (DWORD)pBuffer;//*<----is line 520 of error
    *dwImportsSize = *dwOutSize - *dwIATSize;    
    return pBuffer;
}
#pragma pack(1)
typedef struct

Can someone help me with this error? Do you need more code to have a good answer?

+4
source share
3 answers

This warning is not always an error, sometimes just the result of optimization. Since this is in your code, and you do not know what it is, this may be a mistake.

, :

int i;

if (this_and_that)
    i = 5;

if (whatever)
    printf("%d\n", i);  // <--- this may give a potential blahblah warning

, , whatever , this_and_that , , printf , i , this_and_that whatever, . , . , - .

+5

,

  • pNamesPtr, , ;
  • , .

. - ? , , .

, , , , ?

, , nullptr . , , - .

+2

:

xtype *pNamesPtr = NULL
-1

Source: https://habr.com/ru/post/1529133/


All Articles