X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwin32_apply.c;fp=src%2Fwin32_apply.c;h=94285aca793cf763cd1cf377ecaace6be4eb1bcf;hp=96d9df6f578842eea91fc7b5308066b9a0df5715;hb=c0d3fd10d0cba3fedfa917e04d39a7803e34df6e;hpb=50f603f90c63795aaa604e96d10790d872ac5093 diff --git a/src/win32_apply.c b/src/win32_apply.c index 96d9df6f..94285aca 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -1087,6 +1087,12 @@ prepare_target(struct list_head *dentry_list, struct win32_apply_ctx *ctx) 8 + 1 + 3); ctx->pathbuf.MaximumLength = path_max * sizeof(wchar_t); + if (ctx->pathbuf.MaximumLength != path_max * sizeof(wchar_t)) { + /* Paths are too long for a UNICODE_STRING! */ + ERROR("Some paths are too long to extract (> 32768 characters)!"); + return WIMLIB_ERR_UNSUPPORTED; + } + ctx->pathbuf.Buffer = MALLOC(ctx->pathbuf.MaximumLength); if (!ctx->pathbuf.Buffer) return WIMLIB_ERR_NOMEM;