diff --git a/output/outobj.c b/output/outobj.c index 0d4d3110..f5ab7a24 100644 --- a/output/outobj.c +++ b/output/outobj.c @@ -424,6 +424,12 @@ static ObjRecord *obj_name(ObjRecord * orp, const char *name) int len = strlen(name); uint8_t *ptr; + if (len > UINT8_MAX) { + nasm_warn(WARN_OTHER, "cutting object name '%128s...' to %u bytes", + name, UINT8_MAX); + len = UINT8_MAX; + } + orp = obj_check(orp, len + 1); ptr = orp->buf + orp->used; *ptr++ = len;