mirror of
https://github.com/alexhopeoconnor/DFTE.git
synced 2026-10-03 22:21:59 +10:00
Harden DFTE rendering and placeholder registration to fail safely under stalled and invalid inputs.
Add regression coverage and docs updates so these edge cases stay stable across board test runs.
This commit is contained in:
@@ -127,7 +127,7 @@ public:
|
||||
static size_t getDynamicTemplateLength(const DynamicTemplateDescriptor* descriptor, const char* templateData);
|
||||
|
||||
private:
|
||||
static constexpr uint16_t MAX_PLACEHOLDER_NAME_SIZE = DFTE_PLACEHOLDER_NAME_SIZE_DEFAULT;
|
||||
static constexpr uint16_t MAX_PLACEHOLDER_NAME_SIZE = DFTE_PLACEHOLDER_NAME_SIZE;
|
||||
|
||||
PlaceholderEntry* placeholders; // Dynamically allocated array
|
||||
uint16_t maxPlaceholders; // Configurable size
|
||||
|
||||
@@ -87,11 +87,15 @@ struct PlaceholderEntry {
|
||||
PlaceholderType type;
|
||||
const void* data;
|
||||
PlaceholderLengthGetter getLength;
|
||||
size_t cachedLength;
|
||||
bool hasCachedLength;
|
||||
|
||||
PlaceholderEntry()
|
||||
: type(PlaceholderType::RAM_DATA),
|
||||
data(nullptr),
|
||||
getLength(nullptr) {
|
||||
getLength(nullptr),
|
||||
cachedLength(0),
|
||||
hasCachedLength(false) {
|
||||
name[0] = '\0';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -44,12 +44,5 @@ using TemplateRenderer = DeviceFrameworkTemplateRenderer;
|
||||
using TemplateContext = DeviceFrameworkTemplateContext;
|
||||
using PlaceholderRegistry = DeviceFrameworkPlaceholderRegistry;
|
||||
|
||||
// Use new type names
|
||||
using PlaceholderType = PlaceholderType;
|
||||
using PlaceholderEntry = PlaceholderEntry;
|
||||
using RenderingContextType = RenderingContextType;
|
||||
using RenderingContext = RenderingContext;
|
||||
using TemplateRenderState = TemplateRenderState;
|
||||
|
||||
#endif // TEMPLATE_ENGINE_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user