RTEMS | cpukit/stringto: add null check for input string in stringto* methods (!929)
Gedare Bloom (@gedare)
gitlab at rtems.org
Fri Feb 6 17:16:39 UTC 2026
Gedare Bloom started a new discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/929#note_142031
Formatting needs to be fixed. I'll share some instructions soon, but here's the correct way for this diff:
```
diff --git a/testsuites/libtests/stringto01/stringto_test_template.h b/testsuites/libtests/stringto01/stringto_test_template.h
index 460635db7e..3d12f1492c 100644
--- a/testsuites/libtests/stringto01/stringto_test_template.h
+++ b/testsuites/libtests/stringto01/stringto_test_template.h
@@ -55,14 +55,17 @@ void TEST_STRING_TO_NAME( void )
/* Null pointer for input string */
puts(
- STRING_TO_NAME_METHOD_STRING
- " - NULL input string - RTEMS_INVALID_ADDRESS"
+ STRING_TO_NAME_METHOD_STRING " - NULL input string - RTEMS_INVALID_ADDRESS"
);
- #if defined(STRING_TO_INTEGER)
- status = STRING_TO_NAME_METHOD( NULL, &value, &endptr,
- get_base_10_or_16( GOOD_VALUE_STRING ) );
- #elif defined(STRING_TO_POINTER) || defined(STRING_TO_FLOAT)
- status = STRING_TO_NAME_METHOD( NULL, &value, &endptr );
+ #if defined( STRING_TO_INTEGER )
+ status = STRING_TO_NAME_METHOD(
+ NULL,
+ &value,
+ &endptr,
+ get_base_10_or_16( GOOD_VALUE_STRING )
+ );
+ #elif defined( STRING_TO_POINTER ) || defined( STRING_TO_FLOAT )
+ status = STRING_TO_NAME_METHOD( NULL, &value, &endptr );
#endif
rtems_test_assert( status == RTEMS_INVALID_ADDRESS );
```
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/929#note_142031
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260206/1f851779/attachment.htm>
More information about the bugs
mailing list