import: make check-pointer-deref clean

Add the needed assert changes to make the code clean
for the new check-pointer-deref script.
This commit is contained in:
Michael Vogt
2026-03-27 11:30:32 +01:00
parent f124464b45
commit 44b2d1e155
5 changed files with 11 additions and 1 deletions
-1
View File
@@ -2979,7 +2979,6 @@ if spatch.found()
coccinelle_exclude = [
'src/basic/',
'src/core/',
'src/import/',
'src/journal/',
'src/libsystemd/',
'src/network/',
+2
View File
@@ -359,6 +359,8 @@ int curl_header_strdup(const void *contents, size_t sz, const char *field, char
const char *p;
char *s;
assert(value);
p = memory_startswith_no_case(contents, sz, field);
if (!p)
return 0;
+4
View File
@@ -318,6 +318,10 @@ static int enlarge_buffer(void **buffer, size_t *buffer_size, size_t *buffer_all
size_t l;
void *p;
assert(buffer);
assert(buffer_size);
assert(buffer_allocated);
if (*buffer_allocated > *buffer_size)
return 0;
+1
View File
@@ -622,6 +622,7 @@ int pull_job_restart_with_sha256sum(PullJob *j, char **ret) {
int r;
assert(j);
assert(ret);
/* Generic implementation of a PullJobNotFound handler, that restarts the job requesting SHA256SUMS */
+4
View File
@@ -150,6 +150,10 @@ static int normalize_offset(
bool *compressed,
uint64_t *compressed_size) {
assert(ret);
POINTER_MAY_BE_NULL(compressed);
POINTER_MAY_BE_NULL(compressed_size);
uint64_t q;
q = be64toh(p);