Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized variable in ftw #1

Open
JeffMill opened this issue Jan 6, 2023 · 0 comments
Open

Uninitialized variable in ftw #1

JeffMill opened this issue Jan 6, 2023 · 0 comments

Comments

@JeffMill
Copy link

JeffMill commented Jan 6, 2023

struct FTW lev = {0};
struct history new;
new.chain = h;
new.dev = st.st_dev;
new.ino = st.st_ino;
new.level = h ? h->level+1 : 0;

/* TODO not recursive, so refactor this to make lev be
	* function-scope and increment/decerment lev.level as
	* directories are entered/exited; it will also know to
	* exit when fd_limit is exceeded
	*/
(void)fd_limit;
lev.level = new.level;
lev.base = wcslen(dir->path);

/* skip directories named '.' and '..' */
if (thisname[0] == L'.'
	&& (!thisname[1]
		|| (thisname[1] == L'.'
			&& !thisname[2]
		)
	)
)
	continue;

wstat(wpath, &st);

you are referencing st.st_dev and st.st_ino before you call wstat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant