1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 10:25:37 +03:00

Merge pull request #31664 from bluca/coverity

Coverity fixes
This commit is contained in:
Mike Yuan 2024-03-07 16:02:57 +08:00 committed by GitHub
commit 661ece467a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -454,7 +454,7 @@ char* octescape(const char *s, size_t len) {
if (len == SIZE_MAX)
len = strlen(s);
if (len > (SIZE_MAX)-1/4)
if (len > (SIZE_MAX - 1) / 4)
return NULL;
t = buf = new(char, len * 4 + 1);

View File

@ -450,7 +450,7 @@ bool shall_synthesize_own_hostname_rrs(void) {
if (r < 0 && r != -ENXIO)
log_debug_errno(r, "Failed to parse $SYSTEMD_RESOLVED_SYNTHESIZE_HOSTNAME: %m");
return (cached = r != 0);
return (cached = (r != 0));
}
int dns_synthesize_answer(