Bugfix/ubasic-string-tokenizer-null-termination (#1196)
* Fixed tokenizer_string() off-by-one buffer overflow when processing string literals longer than the buffer limit. * Fixed ubasic potential string buffer overflows by using snprintf instead of sprintf. * Fixed ubasic label strings to use UBASIC_LABEL_LEN_MAX as buffer limit. * Fixed ubasic string variables to initialize with zeros. * Fixed compile errors when UBASIC_DEBUG_STRINGVARIABLES is defined. * Added ubasic string variables user accessor API and unit testing for ubasic string variables. * Fixed tokenizer_label() off-by-one buffer overflow when processing string literals longer than the buffer limit.
This commit is contained in:
@@ -270,6 +270,8 @@ int16_t ubasic_get_stringvariable(struct ubasic_data *data, uint8_t varnum);
|
||||
BACNET_STACK_EXPORT
|
||||
void ubasic_set_stringvariable(
|
||||
struct ubasic_data *data, uint8_t varnum, int16_t size);
|
||||
BACNET_STACK_EXPORT
|
||||
const char *ubasic_ptr_stringvariable(struct ubasic_data *data, char variable);
|
||||
#endif
|
||||
|
||||
/* API to interface and initialize the ported hardware drivers */
|
||||
|
||||
Reference in New Issue
Block a user