You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Off-by-one buffer overflow in metadata label setter #141
In src/service-maker/sources/core/src/metadata.cpp:320-323 (exposed through Python bindings at src/service-maker/sources/python/src/bindings/metadata.h:789):
The destination label buffer (obj_label in NvDsObjectMeta, defined in includes/nvdsmeta.h) is fixed at MAX_LABEL_SIZE bytes (128 bytes).
In the label setter:
When an input string of length $\ge 128$ is provided, the setter places a null terminator at index MAX_LABEL_SIZE ([128]), and uses an unbounded copy (strcpy). This writes 128 content bytes plus a terminating null byte (129 bytes total) into a 128-byte destination array, creating an off-by-one heap/buffer overflow.
Proposed Solution
Ensure string copying bounds the copy to sizeof(dest) - 1 bytes and guarantees termination inside the buffer:
Activity
fc-camel commentedon Nov 23, 2026
@3453-315h Thank you for finding such potential security issue. We will check and get it fixed.