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:
@@ -2979,7 +2979,6 @@ if spatch.found()
|
||||
coccinelle_exclude = [
|
||||
'src/basic/',
|
||||
'src/core/',
|
||||
'src/import/',
|
||||
'src/journal/',
|
||||
'src/libsystemd/',
|
||||
'src/network/',
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user