Message ID | 20241228115446.2478706-5-mjt@tls.msk.ru (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [PULL,01/11] docs/devel: remove dead video link for sourcehut submit process | expand |
diff --git a/block/vvfat.c b/block/vvfat.c index 8ffe8b3b9b..f2eafaa923 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -426,6 +426,10 @@ static direntry_t *create_long_filename(BDRVVVFATState *s, const char *filename) else if(offset<22) offset=14+offset-10; else offset=28+offset-22; entry=array_get(&(s->directory),s->directory.next-1-(i/26)); + /* ensure we don't write anything past entry->name */ + if (offset >= sizeof(entry->name)) { + continue; + } if (i >= 2 * length + 2) { entry->name[offset] = 0xff; } else if (i % 2 == 0) {