diff options
Diffstat (limited to 'os/common/oslib/src')
-rw-r--r-- | os/common/oslib/src/chfactory.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/os/common/oslib/src/chfactory.c b/os/common/oslib/src/chfactory.c index 05a4f5d8e..dbb13cab8 100644 --- a/os/common/oslib/src/chfactory.c +++ b/os/common/oslib/src/chfactory.c @@ -135,6 +135,8 @@ static dyn_element_t *dyn_create_object_heap(const char *name, }
/* Allocating space for the new buffer object.*/
+ /*lint -save -e668 [] Lint is confused by the above chDbgCheck() and
+ incorrectly assumes that strncpy() could receive a NULL pointer.*/
dep = (dyn_element_t *)chHeapAlloc(NULL, size);
if (dep == NULL) {
return NULL;
@@ -142,6 +144,7 @@ static dyn_element_t *dyn_create_object_heap(const char *name, /* Initializing object list element.*/
strncpy(dep->name, name, CH_CFG_FACTORY_MAX_NAMES_LENGTH);
+ /*lint -restore*/
dep->refs = (ucnt_t)1;
dep->next = dlp->next;
@@ -187,7 +190,10 @@ static dyn_element_t *dyn_create_object_pool(const char *name, }
/* Initializing object list element.*/
+ /*lint -save -e668 [] Lint is confused by the above chDbgCheck() and
+ incorrectly assumes that strncpy() could receive a NULL pointer.*/
strncpy(dep->name, name, CH_CFG_FACTORY_MAX_NAMES_LENGTH);
+ /*lint -restore*/
dep->refs = (ucnt_t)1;
dep->next = dlp->next;
|