mirror of
https://github.com/adafruit/Adafruit-GFX-Library.git
synced 2026-07-28 04:16:01 +00:00
Merge pull request #350 from bobwolff68/master
Dangerous edge case for non-null-terminated string
This commit is contained in:
@@ -1661,6 +1661,7 @@ void Adafruit_GFX_Button::initButtonUL(Adafruit_GFX *gfx, int16_t x1,
|
||||
_textsize_y = textsize_y;
|
||||
_gfx = gfx;
|
||||
strncpy(_label, label, 9);
|
||||
_label[9] = 0; // strncpy does not place a null at the end. When 'label' is 9 characters, _label is not terminated.
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user