Function call of 'SysTargetGet...' overwrites application memory (corrected from V1.6)

Corrected from:
Controller c520 V1.6
Controller c550 V1.6
Controller c750 V1.6

Response of the new version:
Of the functions from the library 'SysTarget', only the application memory defined via the inputs of the functions is written. 

What happens?
When using the following functions from the library 'SysTarget', 4 bytes of application memory are overwritten behind the variable that is passed to the input 'pnMaxLength' of the functions:
  • SysTargetGetVendorName
  • SysTargetGetNodeName
  • SysTargetGetDeviceName
  • SysTargetGetSerialNumber

When does the behaviour occur?
The behaviour occurs when the above functions are used.
 
Which products are affected?
Controller c520 from V1.0
Controller c550 from V1.0
Controller c750 from V1.0

Short-term measures:
Do not use the above functions.
 
Evaluation / recommendations:
Addresses of variables are passed to the above functions, into which the respective function writes the requested value (e.g. the vendor name). In doing so, more application memory is written than specified via the input 'pnMaxLength' of the function. I.e., the value of variables that are located behind the variable described above in the application memory changes as a result. Since these variables are not necessarily related to the function, troubleshooting is extremely difficult.

Automatic Translation

URL for linking this AKB article: https://www.lenze.com/en-de/go/akb/202000392/1/
Contact form