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

Nitpicks from clang-scan #528

Merged
merged 2 commits into from
Jan 28, 2022
Merged

Nitpicks from clang-scan #528

merged 2 commits into from
Jan 28, 2022

Conversation

gperciva
Copy link
Member

No description provided.

@gperciva
Copy link
Member Author

These are the nitpicks in tarsnap code, not including the false positives (discussed in #527).

There's a lot more nitpicks in libarchive code. I'll prepare a separate branch for (some of?) those, although my first guess is that we won't want to merge it due to diverting from libarchive.

@gperciva gperciva marked this pull request as draft January 27, 2022 04:16
@gperciva
Copy link
Member Author

Actually, I think some of the libarchive changes are worth doing, so I'll add them here when they're ready.

@gperciva gperciva marked this pull request as ready for review January 28, 2022 19:15
Compilers and static analysis tools can't work out that sp is always
non-NULL when we use it, due to the combination of:

	for (h = 0; h < sleepers_getsize(sleepers); h++) {
		sp = *sleepers_get(sleepers, h);
		...
	}

	if (h == sleepers_getsize(sleepers)) {
		...
	}

	/* Use sp. */

Reported by:	gcc, clang, clang scan-build
archive_read_format_tar_read_advance() is not part of libarchive (it's a
tarsnap-specific addition).

Reported by:	clang scan-build
@cperciva cperciva merged commit 52e8b0c into master Jan 28, 2022
@gperciva gperciva deleted the clang-scan branch January 28, 2022 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants