Strange Error during execution
-
Hello, I'm getting this error: Run-Time Check Failure #2 - Stack around the variable 'UniqueID' was corrupted. Here's the function that generates it
__declspec( dllexport ) BYTE* LaunchMe(BYTE* id) { SERIAL *serial=NULL; BYTE ProductID[BUFFER_LENGHT]; BYTE UniqueID[16]; char *ProductID_Processed=(char*)malloc(BUFFER_LENGHT); serial=(SERIAL*)malloc(sizeof(SERIAL)); memset(serial, 0, sizeof(SERIAL)); memset(&ProductID, 0, BUFFER_LENGHT); memset(&UniqueID, 0, 24); getHardDriveComputerID (serial); if ( GetProductID(ProductID, BUFFER_LENGHT) == false) return false; ProductID_Processed=ProcessProductID(ProductID, BUFFER_LENGHT); if (ProductID_Processed == NULL) return false; CalculateUniqueID(serial->serial, ProductID_Processed,UniqueID); memcpy(id, UniqueID, 16); return NULL; }
Which is the cause of that error? What "around" means?? I get this error some other time also, and google wasn't able to help me, thanks in advance Paolo -
Hello, I'm getting this error: Run-Time Check Failure #2 - Stack around the variable 'UniqueID' was corrupted. Here's the function that generates it
__declspec( dllexport ) BYTE* LaunchMe(BYTE* id) { SERIAL *serial=NULL; BYTE ProductID[BUFFER_LENGHT]; BYTE UniqueID[16]; char *ProductID_Processed=(char*)malloc(BUFFER_LENGHT); serial=(SERIAL*)malloc(sizeof(SERIAL)); memset(serial, 0, sizeof(SERIAL)); memset(&ProductID, 0, BUFFER_LENGHT); memset(&UniqueID, 0, 24); getHardDriveComputerID (serial); if ( GetProductID(ProductID, BUFFER_LENGHT) == false) return false; ProductID_Processed=ProcessProductID(ProductID, BUFFER_LENGHT); if (ProductID_Processed == NULL) return false; CalculateUniqueID(serial->serial, ProductID_Processed,UniqueID); memcpy(id, UniqueID, 16); return NULL; }
Which is the cause of that error? What "around" means?? I get this error some other time also, and google wasn't able to help me, thanks in advance Paolo -
Hello, I'm getting this error: Run-Time Check Failure #2 - Stack around the variable 'UniqueID' was corrupted. Here's the function that generates it
__declspec( dllexport ) BYTE* LaunchMe(BYTE* id) { SERIAL *serial=NULL; BYTE ProductID[BUFFER_LENGHT]; BYTE UniqueID[16]; char *ProductID_Processed=(char*)malloc(BUFFER_LENGHT); serial=(SERIAL*)malloc(sizeof(SERIAL)); memset(serial, 0, sizeof(SERIAL)); memset(&ProductID, 0, BUFFER_LENGHT); memset(&UniqueID, 0, 24); getHardDriveComputerID (serial); if ( GetProductID(ProductID, BUFFER_LENGHT) == false) return false; ProductID_Processed=ProcessProductID(ProductID, BUFFER_LENGHT); if (ProductID_Processed == NULL) return false; CalculateUniqueID(serial->serial, ProductID_Processed,UniqueID); memcpy(id, UniqueID, 16); return NULL; }
Which is the cause of that error? What "around" means?? I get this error some other time also, and google wasn't able to help me, thanks in advance Paolo