Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 105976e5 authored by Dylan Chang's avatar Dylan Chang Committed by lio.chen
Browse files

Fix out-of-bounds on disk usage feature

Change-Id: I65aac997a9bd39ec4f8c69b57dde5a567b6c71c7
parent 39e558b5
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -188,6 +188,11 @@ static bool printdir_sub(struct dir_context *ctx, const char *name, int namlen,
	int ret = 0;
	int is_dir = 0;

	if (namlen >= F2FS_NAME_LEN) {
		ret = -F2FS_NAME_LEN;
		goto ERR_OUT;
	}

	strncpy(real_name, name, namlen);
	real_name[namlen] = '\0';