Critical checks

Project: 
gurux.dlms.c

Hi!
There is a critical moment in the code of the entire library. Nowhere is there a check for uninitialized pointers in functions where pointers to structures are passed in parameters. Such a check is important for the stable operation of the library in critical applications (it is possible not to crash the system, but to continue working with restrictions).

Status: 
Closed (works as designed)
Priority: 
Major
Category: 
Bug report
Component: 
Code
Reporter: 
trgv
Created: 
Fri, 10/15/2021 - 14:29
Updated: 
Fri, 10/29/2021 - 10:08

Comments

Kurumi's picture

Hi,

Thank you for your care.

I believe that you are talking from the NULL check. That will work only if the pointer is set to NULL.
It doesn't work if the value is not initialized to NULL and most compilers don't do it automatically.
That will cause that it's not possible to check.

//This can be checked.
gxRegister* ptr1 = NULL;
//There is no way to check if this pointer is correct or not.
gxRegister* ptr2;

BR,
Mikko

Kurumi's picture

Status: Active » Closed (works as designed)