mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 10:32:13 -04:00
fix: nil: Update the semantic patches to use new coccinelle syntax
Merge branch 'ondrej/update-semantic-patches' into 'main' See merge request isc-projects/bind9!11067
This commit is contained in:
commit
b3c025837d
34 changed files with 399 additions and 834 deletions
|
|
@ -1129,9 +1129,7 @@ is_delegation(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *origin,
|
|||
result = dns_db_findrdataset(db, node, ver, dns_rdatatype_ns, 0, 0,
|
||||
&nsset, NULL);
|
||||
if (dns_rdataset_isassociated(&nsset)) {
|
||||
if (ttlp != NULL) {
|
||||
*ttlp = nsset.ttl;
|
||||
}
|
||||
SET_IF_NOT_NULL(ttlp, nsset.ttl);
|
||||
dns_rdataset_disassociate(&nsset);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -511,9 +511,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
|||
id, oldid);
|
||||
}
|
||||
} else {
|
||||
if (exact != NULL) {
|
||||
*exact = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(exact, true);
|
||||
if (verbose > 1) {
|
||||
fprintf(stderr, "Key ID %d exists\n",
|
||||
id);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
@replacement@
|
||||
expression e;
|
||||
@@
|
||||
identifier RRSIG = dns_rdatatype_rrsig;
|
||||
expression T;
|
||||
@@
|
||||
|
||||
- DNS_TYPEPAIR_VALUE(RRSIG, T)
|
||||
+ DNS_SIGTYPEPAIR(T)
|
||||
-DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig,
|
||||
+DNS_SIGTYPE(
|
||||
e)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
@@
|
||||
@replacement@
|
||||
expression E;
|
||||
int R;
|
||||
@@
|
||||
|
||||
R = E(...);
|
||||
- UV_RUNTIME_CHECK(...);
|
||||
+ UV_RUNTIME_CHECK(E, R);
|
||||
R = E(...);
|
||||
UV_RUNTIME_CHECK(
|
||||
- ...
|
||||
+ E, R
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,105 +1,23 @@
|
|||
@@
|
||||
@add_cast@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isalnum(T)
|
||||
+ isalnum((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isalpha(T)
|
||||
+ isalpha((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- iscntrl(T)
|
||||
+ iscntrl((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isdigit(T)
|
||||
+ isdigit((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isgraph(T)
|
||||
+ isgraph((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- islower(T)
|
||||
+ islower((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isprint(T)
|
||||
+ isprint((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- ispunct(T)
|
||||
+ ispunct((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isspace(T)
|
||||
+ isspace((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isupper(T)
|
||||
+ isupper((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isxdigit(T)
|
||||
+ isxdigit((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isascii(T)
|
||||
+ isascii((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- isblank(T)
|
||||
+ isblank((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- tolower(T)
|
||||
+ tolower((unsigned char)T)
|
||||
|
||||
@@
|
||||
char T;
|
||||
@@
|
||||
|
||||
- toupper(T)
|
||||
+ toupper((unsigned char)T)
|
||||
|
||||
(isalnum
|
||||
|isalpha
|
||||
|iscntrl
|
||||
|isdigit
|
||||
|isgraph
|
||||
|islower
|
||||
|isprint
|
||||
|ispunct
|
||||
|isspace
|
||||
|isupper
|
||||
|isxdigit
|
||||
|isascii
|
||||
|isblank
|
||||
|tolower
|
||||
|toupper
|
||||
)
|
||||
(
|
||||
+(unsigned char)
|
||||
T
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@renaming@
|
||||
expression e;
|
||||
@@
|
||||
expression M;
|
||||
@@
|
||||
|
||||
- dns_message_destroy(M);
|
||||
+ dns_message_detach(M);
|
||||
-dns_message_destroy
|
||||
+dns_message_detach
|
||||
(e);
|
||||
|
|
|
|||
|
|
@ -1,155 +1,35 @@
|
|||
@@
|
||||
@deletion@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettempname(...);
|
||||
- if (V != ISC_R_SUCCESS) S
|
||||
|
||||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdata(...);
|
||||
- if (V != ISC_R_SUCCESS) S
|
||||
|
||||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdataset(...);
|
||||
- if (V != ISC_R_SUCCESS) S
|
||||
|
||||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdatalist(...);
|
||||
- if (V != ISC_R_SUCCESS) S
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- CHECK(
|
||||
dns_message_gettempname(...)
|
||||
- )
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- CHECK(
|
||||
dns_message_gettemprdata(...)
|
||||
- )
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- CHECK(
|
||||
dns_message_gettemprdataset(...)
|
||||
- )
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- CHECK(
|
||||
dns_message_gettemprdatalist(...)
|
||||
- )
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- RETERR(
|
||||
dns_message_gettempname(...)
|
||||
- )
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- RETERR(
|
||||
dns_message_gettemprdata(...)
|
||||
- )
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- RETERR(
|
||||
dns_message_gettemprdataset(...)
|
||||
- )
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- RETERR(
|
||||
dns_message_gettemprdatalist(...)
|
||||
- )
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettempname(...);
|
||||
- check_result(V, ...);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdata(...);
|
||||
- check_result(V, ...);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdataset(...);
|
||||
- check_result(V, ...);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdatalist(...);
|
||||
- check_result(V, ...);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettempname(...);
|
||||
- CHECK(..., V);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdata(...);
|
||||
- CHECK(..., V);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdataset(...);
|
||||
- CHECK(..., V);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
dns_message_gettemprdatalist(...);
|
||||
- CHECK(..., V);
|
||||
(
|
||||
-V =
|
||||
( dns_message_gettempname
|
||||
| dns_message_gettemprdata
|
||||
| dns_message_gettemprdataset
|
||||
| dns_message_gettemprdatalist
|
||||
)
|
||||
(...);
|
||||
(
|
||||
-if (V != ISC_R_SUCCESS) S
|
||||
|
|
||||
(
|
||||
-check_result(V, ...)
|
||||
|
|
||||
-CHECK(..., V)
|
||||
);
|
||||
)
|
||||
|
|
||||
(
|
||||
-CHECK
|
||||
|
|
||||
-RETERR
|
||||
)
|
||||
-(
|
||||
( dns_message_gettempname
|
||||
| dns_message_gettemprdata
|
||||
| dns_message_gettemprdataset
|
||||
| dns_message_gettemprdatalist
|
||||
)
|
||||
-)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@deletion@
|
||||
expression C, M;
|
||||
@@
|
||||
expression C;
|
||||
expression M;
|
||||
@@
|
||||
dns_rbtnodechain_init(C
|
||||
- , M
|
||||
);
|
||||
|
||||
- dns_rbtnodechain_init(C, M);
|
||||
+ dns_rbtnodechain_init(C);
|
||||
|
|
|
|||
|
|
@ -1,75 +1,38 @@
|
|||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
isc_buffer_allocate(...);
|
||||
- if (V != ISC_R_SUCCESS) S
|
||||
|
||||
@@
|
||||
@deletion1@
|
||||
statement S1, S2;
|
||||
expression V;
|
||||
@@
|
||||
-V =
|
||||
isc_buffer_allocate(...);
|
||||
(
|
||||
-if (V != ISC_R_SUCCESS) S1
|
||||
|
|
||||
-if (V == ISC_R_SUCCESS)
|
||||
S1
|
||||
-else S2
|
||||
|
|
||||
-check_result(V, ...);
|
||||
|
|
||||
-assert_int_equal(V, ISC_R_SUCCESS);
|
||||
|
|
||||
-CHECK(..., V);
|
||||
|
|
||||
-RUNTIME_CHECK(V == ISC_R_SUCCESS);
|
||||
)
|
||||
|
||||
- V =
|
||||
isc_buffer_allocate(...);
|
||||
- if (V == ISC_R_SUCCESS)
|
||||
S1
|
||||
- else S2
|
||||
|
||||
@deletion2@
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
isc_buffer_allocate(...);
|
||||
- check_result(V, ...);
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- CHECK(
|
||||
isc_buffer_allocate(...)
|
||||
- )
|
||||
;
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- DO(...,
|
||||
isc_buffer_allocate(...)
|
||||
- )
|
||||
;
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- RETERR(
|
||||
isc_buffer_allocate(...)
|
||||
- )
|
||||
;
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
isc_buffer_allocate(...);
|
||||
- assert_int_equal(V, ISC_R_SUCCESS);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
isc_buffer_allocate(...);
|
||||
- CHECK(..., V);
|
||||
|
||||
@@
|
||||
expression V;
|
||||
@@
|
||||
|
||||
- V =
|
||||
isc_buffer_allocate(...);
|
||||
- RUNTIME_CHECK(V == ISC_R_SUCCESS);
|
||||
(
|
||||
(
|
||||
-CHECK
|
||||
|
|
||||
-RETERR
|
||||
)
|
||||
-(
|
||||
isc_buffer_allocate(...)
|
||||
-)
|
||||
|
|
||||
-DO(...,
|
||||
isc_buffer_allocate(...)
|
||||
-)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,41 +1,19 @@
|
|||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = isc_mem_allocate(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
@deletion@
|
||||
type T;
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = (T *)isc_mem_allocate(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
if (V == NULL) V = isc_mem_allocate(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
statement S1, S2;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = isc_mem_allocate(...);
|
||||
- if (V == NULL) S1 else { S2 }
|
||||
+ S2
|
||||
|
||||
@@
|
||||
type T;
|
||||
expression V, E1, E2;
|
||||
@@
|
||||
|
||||
- V = (T)isc_mem_allocate(E1, E2);
|
||||
+ V = isc_mem_allocate(E1, E2);
|
||||
(V =
|
||||
(isc_mem_allocate
|
||||
|(T *)isc_mem_allocate
|
||||
)(...);
|
||||
-if (V == NULL) S1
|
||||
|V = isc_mem_allocate(...);
|
||||
-if (V == NULL) S1 else { S2 }
|
||||
+S2
|
||||
|if (V == NULL) V = isc_mem_allocate(...);
|
||||
-if (V == NULL) S1
|
||||
|V =
|
||||
- (T)
|
||||
isc_mem_allocate(E1, E2);
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,161 +1,136 @@
|
|||
@@
|
||||
expression MCTX, COUNT;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- isc_mem_get(MCTX, COUNT * sizeof(ELEM))
|
||||
+ isc_mem_cget(MCTX, COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
@replacement1@
|
||||
expression MCTX, COUNT, ELEM;
|
||||
type T;
|
||||
@@
|
||||
-isc_mem_get
|
||||
+isc_mem_cget
|
||||
(MCTX,
|
||||
(
|
||||
- COUNT * sizeof(ELEM)
|
||||
+ COUNT, sizeof(ELEM)
|
||||
|
|
||||
- COUNT * sizeof(T)
|
||||
+ COUNT, sizeof(T)
|
||||
)
|
||||
)
|
||||
|
||||
- isc_mem_get(MCTX, COUNT * sizeof(ELEM))
|
||||
+ isc_mem_cget(MCTX, COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, COUNT;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- isc_mem_put(MCTX, OLD_PTR, COUNT * sizeof(ELEM))
|
||||
+ isc_mem_cput(MCTX, OLD_PTR, COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
@replacement2@
|
||||
expression MCTX, OLD_PTR, COUNT, ELEM;
|
||||
type T;
|
||||
@@
|
||||
-isc_mem_put
|
||||
+isc_mem_cput
|
||||
(MCTX,
|
||||
OLD_PTR,
|
||||
(
|
||||
- COUNT * sizeof(ELEM)
|
||||
+ COUNT, sizeof(ELEM)
|
||||
|
|
||||
- COUNT * sizeof(T)
|
||||
+ COUNT, sizeof(T)
|
||||
)
|
||||
)
|
||||
|
||||
- isc_mem_put(MCTX, OLD_PTR, COUNT * sizeof(ELEM))
|
||||
+ isc_mem_cput(MCTX, OLD_PTR, COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
expression MCTX, COUNT;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- isc_mem_get(MCTX, sizeof(ELEM) * COUNT)
|
||||
+ isc_mem_cget(MCTX, COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
expression MCTX, COUNT, ELEM;
|
||||
@@
|
||||
|
||||
- isc_mem_get(MCTX, sizeof(ELEM) * COUNT)
|
||||
+ isc_mem_cget(MCTX, COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, COUNT;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- isc_mem_put(MCTX, OLD_PTR, sizeof(ELEM) * COUNT)
|
||||
+ isc_mem_cput(MCTX, OLD_PTR, COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, COUNT, ELEM;
|
||||
@@
|
||||
|
||||
- isc_mem_put(MCTX, OLD_PTR, sizeof(ELEM) * COUNT)
|
||||
+ isc_mem_cput(MCTX, OLD_PTR, COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, NEW_PTR, OLD_COUNT, NEW_COUNT;
|
||||
identifier OLD_SIZE, NEW_SIZE;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- size_t OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
- size_t NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
- NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE);
|
||||
+ NEW_PTR = isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM));
|
||||
|
||||
@@
|
||||
@replacement3@
|
||||
expression MCTX, OLD_PTR, NEW_PTR, OLD_COUNT, NEW_COUNT, ELEM;
|
||||
identifier OLD_SIZE, NEW_SIZE;
|
||||
type T;
|
||||
@@
|
||||
(
|
||||
(
|
||||
-size_t OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
-size_t NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
|
|
||||
-size_t NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
-size_t OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
)
|
||||
NEW_PTR =
|
||||
- isc_mem_reget
|
||||
+ isc_mem_creget
|
||||
(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE
|
||||
+ , sizeof(ELEM)
|
||||
);
|
||||
|
|
||||
(
|
||||
-size_t OLD_SIZE = OLD_COUNT * sizeof(T);
|
||||
-size_t NEW_SIZE = NEW_COUNT * sizeof(T);
|
||||
|
|
||||
-size_t NEW_SIZE = NEW_COUNT * sizeof(T);
|
||||
-size_t OLD_SIZE = OLD_COUNT * sizeof(T);
|
||||
)
|
||||
NEW_PTR =
|
||||
- isc_mem_reget
|
||||
+ isc_mem_creget
|
||||
(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE
|
||||
+ , sizeof(T)
|
||||
);
|
||||
)
|
||||
|
||||
- size_t OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
- size_t NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
- NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE);
|
||||
+ NEW_PTR = isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM));
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, NEW_PTR, OLD_COUNT, NEW_COUNT;
|
||||
identifier OLD_SIZE, NEW_SIZE;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- size_t NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
- size_t OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
- NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE);
|
||||
+ NEW_PTR = isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM));
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, NEW_PTR, OLD_COUNT, NEW_COUNT, ELEM;
|
||||
identifier OLD_SIZE, NEW_SIZE;
|
||||
@@
|
||||
|
||||
- size_t NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
- size_t OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
- NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE);
|
||||
+ NEW_PTR = isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM));
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, NEW_PTR, OLD_SIZE, OLD_COUNT, NEW_SIZE, NEW_COUNT;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
- NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
- NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE);
|
||||
+ NEW_PTR = isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM));
|
||||
|
||||
@@
|
||||
@replacement4@
|
||||
expression MCTX, OLD_PTR, NEW_PTR, OLD_SIZE, OLD_COUNT, NEW_SIZE, NEW_COUNT, ELEM;
|
||||
type T;
|
||||
@@
|
||||
(
|
||||
(
|
||||
-OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
-NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
|
|
||||
-NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
-OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
)
|
||||
NEW_PTR =
|
||||
- isc_mem_reget
|
||||
+ isc_mem_creget
|
||||
(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE
|
||||
+ , sizeof(ELEM)
|
||||
);
|
||||
|
|
||||
(
|
||||
-OLD_SIZE = OLD_COUNT * sizeof(T);
|
||||
-NEW_SIZE = NEW_COUNT * sizeof(T);
|
||||
|
|
||||
-NEW_SIZE = NEW_COUNT * sizeof(T);
|
||||
-OLD_SIZE = OLD_COUNT * sizeof(T);
|
||||
)
|
||||
NEW_PTR =
|
||||
- isc_mem_reget
|
||||
+ isc_mem_creget
|
||||
(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE
|
||||
+ , sizeof(T)
|
||||
);
|
||||
)
|
||||
|
||||
- OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
- NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
- NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE);
|
||||
+ NEW_PTR = isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM));
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, NEW_PTR, OLD_SIZE, OLD_COUNT, NEW_SIZE, NEW_COUNT;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
- OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
- NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE);
|
||||
+ NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM));
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, NEW_PTR, OLD_SIZE, OLD_COUNT, NEW_SIZE, NEW_COUNT, ELEM;
|
||||
@@
|
||||
|
||||
- NEW_SIZE = NEW_COUNT * sizeof(ELEM);
|
||||
- OLD_SIZE = OLD_COUNT * sizeof(ELEM);
|
||||
- NEW_PTR = isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE);
|
||||
+ NEW_PTR = isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM));
|
||||
|
||||
@@
|
||||
expression MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT;
|
||||
type ELEM;
|
||||
@@
|
||||
|
||||
- isc_mem_reget(MCTX, OLD_PTR, OLD_COUNT * sizeof(ELEM), NEW_COUNT * sizeof(ELEM))
|
||||
+ isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
@replacement5@
|
||||
expression MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, ELEM;
|
||||
type T;
|
||||
@@
|
||||
-isc_mem_reget
|
||||
+isc_mem_creget
|
||||
(MCTX,
|
||||
OLD_PTR,
|
||||
(
|
||||
- OLD_COUNT * sizeof(ELEM)
|
||||
+ OLD_COUNT
|
||||
,
|
||||
- NEW_COUNT * sizeof(ELEM)
|
||||
+ NEW_COUNT, sizeof(ELEM)
|
||||
|
|
||||
- OLD_COUNT * sizeof(T)
|
||||
+ OLD_COUNT
|
||||
,
|
||||
- NEW_COUNT * sizeof(T)
|
||||
+ NEW_COUNT, sizeof(T)
|
||||
)
|
||||
)
|
||||
|
||||
- isc_mem_reget(MCTX, OLD_PTR, OLD_COUNT * sizeof(ELEM), NEW_COUNT * sizeof(ELEM))
|
||||
+ isc_mem_creget(MCTX, OLD_PTR, OLD_COUNT, NEW_COUNT, sizeof(ELEM))
|
||||
|
||||
@@
|
||||
@replacement6@
|
||||
expression MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE;
|
||||
@@
|
||||
|
||||
- isc_mem_reget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE)
|
||||
+ isc_mem_creget(MCTX, OLD_PTR, OLD_SIZE, NEW_SIZE, sizeof(char))
|
||||
-isc_mem_reget
|
||||
+isc_mem_creget
|
||||
(MCTX,
|
||||
OLD_PTR,
|
||||
OLD_SIZE,
|
||||
NEW_SIZE
|
||||
+ , sizeof(char)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,41 +1,19 @@
|
|||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = isc_mem_get(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
@deletion@
|
||||
type T;
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = (T *)isc_mem_get(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
if (V == NULL) V = isc_mem_get(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
statement S1, S2;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = isc_mem_get(...);
|
||||
- if (V == NULL) S1 else { S2 }
|
||||
+ S2
|
||||
|
||||
@@
|
||||
type T;
|
||||
expression V, E1, E2;
|
||||
@@
|
||||
|
||||
- V = (T)isc_mem_get(E1, E2);
|
||||
+ V = isc_mem_get(E1, E2);
|
||||
(V =
|
||||
(isc_mem_get
|
||||
|(T *)isc_mem_get
|
||||
)(...);
|
||||
-if (V == NULL) S1
|
||||
|V = isc_mem_get(...);
|
||||
-if (V == NULL) S1 else { S2 }
|
||||
+S2
|
||||
|if (V == NULL) V = isc_mem_get(...);
|
||||
-if (V == NULL) S1
|
||||
|V =
|
||||
- (T)
|
||||
isc_mem_get(E1, E2);
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,80 +1,42 @@
|
|||
@@
|
||||
@deletion1@
|
||||
expression e1, e2;
|
||||
@@
|
||||
(
|
||||
(isc_mem_free
|
||||
|isc_mempool_put
|
||||
)(e1, e2);
|
||||
|if (e2 != NULL)
|
||||
{
|
||||
( isc_mem_free
|
||||
| isc_mempool_put
|
||||
)(e1, e2);
|
||||
}
|
||||
)
|
||||
-e2 = NULL;
|
||||
|
||||
isc_mem_free(e1, e2);
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
expression e1, e2;
|
||||
@@
|
||||
|
||||
if (e2 != NULL) {
|
||||
isc_mem_free(e1, e2);
|
||||
}
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
expression e1, e2;
|
||||
@@
|
||||
|
||||
isc_mempool_put(e1, e2);
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
expression e1, e2;
|
||||
@@
|
||||
|
||||
if (e2 != NULL) {
|
||||
isc_mempool_put(e1, e2);
|
||||
}
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
@deletion2@
|
||||
expression e1, e2, e3;
|
||||
@@
|
||||
(
|
||||
(isc_mem_put
|
||||
|isc_mem_putanddetach
|
||||
)(e1, e2, e3);
|
||||
|if (e2 != NULL)
|
||||
{
|
||||
( isc_mem_put
|
||||
| isc_mem_putanddetach
|
||||
)(e1, e2, e3);
|
||||
}
|
||||
)
|
||||
-e2 = NULL;
|
||||
|
||||
isc_mem_put(e1, e2, e3);
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
expression e1, e2, e3;
|
||||
@@
|
||||
|
||||
if (e2 != NULL) {
|
||||
isc_mem_put(e1, e2, e3);
|
||||
}
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
expression e1, e2, e3;
|
||||
@@
|
||||
|
||||
isc_mem_putanddetach(e1, e2, e3);
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
expression e1, e2, e3;
|
||||
@@
|
||||
|
||||
if (e2 != NULL) {
|
||||
isc_mem_putanddetach(e1, e2, e3);
|
||||
}
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
@deletion3@
|
||||
expression e1, e2, e3, e4;
|
||||
@@
|
||||
|
||||
isc_mem_cput(e1, e2, e3, e4);
|
||||
- e2 = NULL;
|
||||
|
||||
@@
|
||||
expression e1, e2, e3, e4;
|
||||
@@
|
||||
|
||||
if (e2 != NULL) {
|
||||
isc_mem_cput(e1, e2, e3, e4);
|
||||
}
|
||||
- e2 = NULL;
|
||||
|
||||
(isc_mem_cput(e1, e2, e3, e4);
|
||||
|if (e2 != NULL)
|
||||
{
|
||||
isc_mem_cput(e1, e2, e3, e4);
|
||||
}
|
||||
)
|
||||
-e2 = NULL;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
@adjustment@
|
||||
expression M, E1, E2;
|
||||
@@
|
||||
expression M;
|
||||
expression E1, E2;
|
||||
@@
|
||||
|
||||
- isc_mem_put(M, E1, E2);
|
||||
- isc_mem_detach(&M);
|
||||
+ isc_mem_putanddetach(&M, E1, E2);
|
||||
-isc_mem_put
|
||||
+isc_mem_putanddetach
|
||||
(
|
||||
+ &
|
||||
M, E1, E2
|
||||
);
|
||||
-isc_mem_detach(&M);
|
||||
|
|
|
|||
|
|
@ -1,33 +1,16 @@
|
|||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = isc_mem_strdup(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
@deletion@
|
||||
type T;
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = (T *)isc_mem_strdup(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
if (V == NULL) V = isc_mem_strdup(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
statement S1, S2;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = isc_mem_strdup(...);
|
||||
- if (V == NULL) S1 else { S2 }
|
||||
+ S2
|
||||
(V =
|
||||
(isc_mem_strdup
|
||||
|(T *)isc_mem_strdup
|
||||
)(...);
|
||||
-if (V == NULL) S1
|
||||
|if (V == NULL) V = isc_mem_strdup(...);
|
||||
-if (V == NULL) S1
|
||||
|V = isc_mem_strdup(...);
|
||||
-if (V == NULL) S1 else { S2 }
|
||||
+S2
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,41 +1,19 @@
|
|||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = isc_mempool_get(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
@deletion@
|
||||
type T;
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = (T *)isc_mempool_get(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
statement S;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
if (V == NULL) V = isc_mempool_get(...);
|
||||
- if (V == NULL) S
|
||||
|
||||
@@
|
||||
statement S1, S2;
|
||||
expression V;
|
||||
@@
|
||||
|
||||
V = isc_mempool_get(...);
|
||||
- if (V == NULL) S1 else { S2 }
|
||||
+ S2
|
||||
|
||||
@@
|
||||
type T;
|
||||
expression V, E1, E2;
|
||||
@@
|
||||
|
||||
- V = (T)isc_mempool_get(E1, E2);
|
||||
+ V = isc_mempool_get(E1, E2);
|
||||
(V =
|
||||
(isc_mempool_get
|
||||
|(T *)isc_mempool_get
|
||||
)(...);
|
||||
-if (V == NULL) S1
|
||||
|V = isc_mempool_get(...);
|
||||
-if (V == NULL) S1 else { S2 }
|
||||
+S2
|
||||
|if (V == NULL) V = isc_mempool_get(...);
|
||||
-if (V == NULL) S1
|
||||
|V =
|
||||
- (T)
|
||||
isc_mempool_get(E1, E2);
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
@has_string_h@
|
||||
@@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@depends on has_string_h@
|
||||
|
||||
expression D;
|
||||
expression S;
|
||||
expression N;
|
||||
expression D, S, N;
|
||||
@@
|
||||
|
||||
- memcpy(D, S, N);
|
||||
+ memmove(D, S, N);
|
||||
-memcpy
|
||||
+memmove
|
||||
(D, S, N);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,17 @@
|
|||
@ rule1 @
|
||||
@rule1@
|
||||
identifier f1;
|
||||
@@
|
||||
void f1(...)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
void f1(...)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
@ rule2 @
|
||||
identifier rule1.f1;
|
||||
identifier f2;
|
||||
@rule2@
|
||||
identifier rule1.f1, f2;
|
||||
@@
|
||||
|
||||
void f2(...) {
|
||||
...
|
||||
* return(f1(...));
|
||||
...
|
||||
}
|
||||
void f2(...)
|
||||
{
|
||||
<+...
|
||||
*return(f1(...));
|
||||
...+>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
@@
|
||||
@replacement@
|
||||
type T;
|
||||
identifier fun;
|
||||
identifier arg;
|
||||
identifier fun, arg;
|
||||
expression val;
|
||||
@@
|
||||
fun(..., T *arg, ...) {
|
||||
...
|
||||
- if (arg != NULL) {
|
||||
- *arg = val;
|
||||
- }
|
||||
+ SET_IF_NOT_NULL(arg, val);
|
||||
...
|
||||
}
|
||||
fun(..., T *arg, ...)
|
||||
{
|
||||
<+...
|
||||
- if (arg != NULL)
|
||||
- {
|
||||
- *arg = val;
|
||||
- }
|
||||
+ SET_IF_NOT_NULL(arg, val);
|
||||
...+>
|
||||
}
|
||||
|
|
|
|||
19
cocci/unreachable.disabled
Normal file
19
cocci/unreachable.disabled
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
@replacement@
|
||||
@@
|
||||
(
|
||||
-INSIST(0);
|
||||
+UNREACHABLE();
|
||||
... when != UNREACHABLE();
|
||||
|
|
||||
-INSIST(0);
|
||||
-ISC_UNREACHABLE
|
||||
+UNREACHABLE
|
||||
();
|
||||
)
|
||||
|
||||
@deletion@
|
||||
@@
|
||||
<+...
|
||||
-UNREACHABLE();
|
||||
...+>
|
||||
UNREACHABLE();
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
@@
|
||||
@@
|
||||
|
||||
- INSIST(0);
|
||||
+ UNREACHABLE();
|
||||
... when != UNREACHABLE();
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- INSIST(0);
|
||||
- ISC_UNREACHABLE();
|
||||
+ UNREACHABLE();
|
||||
|
||||
@@
|
||||
@@
|
||||
|
||||
- UNREACHABLE();
|
||||
UNREACHABLE();
|
||||
|
|
@ -313,9 +313,7 @@ dns_badcache_find(dns_badcache_t *bc, const dns_name_t *name,
|
|||
|
||||
if (found != NULL && bcentry_alive(ht, found, now)) {
|
||||
result = ISC_R_SUCCESS;
|
||||
if (flagp != NULL) {
|
||||
*flagp = found->flags;
|
||||
}
|
||||
SET_IF_NOT_NULL(flagp, found->flags);
|
||||
}
|
||||
|
||||
isc_tid_t tid = isc_tid();
|
||||
|
|
|
|||
|
|
@ -688,9 +688,7 @@ keymgr_dep(dst_key_t *k, dns_dnsseckeylist_t *keyring, uint32_t *dep) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (dep != NULL) {
|
||||
*dep = dst_key_id(d->key);
|
||||
}
|
||||
SET_IF_NOT_NULL(dep, dst_key_id(d->key));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -759,9 +759,7 @@ findname(dns_name_t **foundname, const dns_name_t *target,
|
|||
dns_namelist_t *section) {
|
||||
ISC_LIST_FOREACH_REV(*section, name, link) {
|
||||
if (dns_name_equal(name, target)) {
|
||||
if (foundname != NULL) {
|
||||
*foundname = name;
|
||||
}
|
||||
SET_IF_NOT_NULL(foundname, name);
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1894,9 +1894,7 @@ dns_nsec3_noexistnodata(dns_rdatatype_t type, const dns_name_t *name,
|
|||
* the deepest covering zone.
|
||||
*/
|
||||
if (!dns_nsec3_supportedhash(nsec3.hash)) {
|
||||
if (unknown != NULL) {
|
||||
*unknown = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(unknown, true);
|
||||
return ISC_R_IGNORE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,9 +170,7 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
|||
if (REMOVE(rdata.data[1])) {
|
||||
continue;
|
||||
}
|
||||
if (build_nsec3 != NULL) {
|
||||
*build_nsec3 = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(build_nsec3, true);
|
||||
break;
|
||||
}
|
||||
goto success;
|
||||
|
|
@ -233,9 +231,7 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
|||
* The last NSEC3 chain is being removed and does not have
|
||||
* have NONSEC set.
|
||||
*/
|
||||
if (build_nsec != NULL) {
|
||||
*build_nsec = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(build_nsec, true);
|
||||
goto success;
|
||||
}
|
||||
|
||||
|
|
@ -274,13 +270,9 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver,
|
|||
|
||||
if (signing) {
|
||||
if (nsec3chain) {
|
||||
if (build_nsec3 != NULL) {
|
||||
*build_nsec3 = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(build_nsec3, true);
|
||||
} else {
|
||||
if (build_nsec != NULL) {
|
||||
*build_nsec = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(build_nsec, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2282,22 +2282,14 @@ getnsec3parameters(dns_db_t *db, dns_dbversion_t *dbversion, dns_hash_t *hash,
|
|||
}
|
||||
|
||||
if (version->havensec3) {
|
||||
if (hash != NULL) {
|
||||
*hash = version->hash;
|
||||
}
|
||||
SET_IF_NOT_NULL(hash, version->hash);
|
||||
if (salt != NULL && salt_length != NULL) {
|
||||
REQUIRE(*salt_length >= version->salt_length);
|
||||
memmove(salt, version->salt, version->salt_length);
|
||||
}
|
||||
if (salt_length != NULL) {
|
||||
*salt_length = version->salt_length;
|
||||
}
|
||||
if (iterations != NULL) {
|
||||
*iterations = version->iterations;
|
||||
}
|
||||
if (flags != NULL) {
|
||||
*flags = version->flags;
|
||||
}
|
||||
SET_IF_NOT_NULL(salt_length, version->salt_length);
|
||||
SET_IF_NOT_NULL(iterations, version->iterations);
|
||||
SET_IF_NOT_NULL(flags, version->flags);
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
RWUNLOCK(&qpdb->lock, isc_rwlocktype_read);
|
||||
|
|
|
|||
|
|
@ -3374,9 +3374,7 @@ findname(fetchctx_t *fctx, const dns_name_t *name, in_port_t port,
|
|||
* No addresses and no pending events: the find failed.
|
||||
*/
|
||||
if ((find->options & DNS_ADBFIND_OVERQUOTA) != 0) {
|
||||
if (overquota != NULL) {
|
||||
*overquota = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(overquota, true);
|
||||
fctx->quotacount++; /* quota exceeded */
|
||||
} else {
|
||||
fctx->adberr++; /* unreachable server, etc. */
|
||||
|
|
|
|||
|
|
@ -1564,9 +1564,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db,
|
|||
CHECK(dns_diff_sort(diff, temp_order));
|
||||
state->state = sign_updates;
|
||||
state->magic = STATE_MAGIC;
|
||||
if (statep != NULL) {
|
||||
*statep = state;
|
||||
}
|
||||
SET_IF_NOT_NULL(statep, state);
|
||||
} else {
|
||||
REQUIRE(DNS_STATE_VALID(*statep));
|
||||
state = *statep;
|
||||
|
|
|
|||
|
|
@ -139,9 +139,7 @@ is_delegation(const vctx_t *vctx, const dns_name_t *name, dns_dbnode_t *node,
|
|||
result = dns_db_findrdataset(vctx->db, node, vctx->ver,
|
||||
dns_rdatatype_ns, 0, 0, &nsset, NULL);
|
||||
if (dns_rdataset_isassociated(&nsset)) {
|
||||
if (ttlp != NULL) {
|
||||
*ttlp = nsset.ttl;
|
||||
}
|
||||
SET_IF_NOT_NULL(ttlp, nsset.ttl);
|
||||
dns_rdataset_disassociate(&nsset);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -492,9 +492,7 @@ tls_try_handshake(isc_nmsocket_t *sock, isc_result_t *presult) {
|
|||
isc_nmhandle_detach(&tlshandle);
|
||||
sock->tlsstream.state = TLS_IO;
|
||||
|
||||
if (presult != NULL) {
|
||||
*presult = result;
|
||||
}
|
||||
SET_IF_NOT_NULL(presult, result);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
|||
|
|
@ -241,9 +241,7 @@ isccc_alist_lookupstring(isccc_sexpr_t *alist, const char *key, char **strp) {
|
|||
if (kv != NULL) {
|
||||
v = CDR(kv);
|
||||
if (isccc_sexpr_stringp(v)) {
|
||||
if (strp != NULL) {
|
||||
*strp = isccc_sexpr_tostring(v);
|
||||
}
|
||||
SET_IF_NOT_NULL(strp, isccc_sexpr_tostring(v));
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
return ISC_R_EXISTS;
|
||||
|
|
@ -262,9 +260,7 @@ isccc_alist_lookupbinary(isccc_sexpr_t *alist, const char *key,
|
|||
if (kv != NULL) {
|
||||
v = CDR(kv);
|
||||
if (isccc_sexpr_binaryp(v)) {
|
||||
if (r != NULL) {
|
||||
*r = isccc_sexpr_tobinary(v);
|
||||
}
|
||||
SET_IF_NOT_NULL(r, isccc_sexpr_tobinary(v));
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
return ISC_R_EXISTS;
|
||||
|
|
|
|||
|
|
@ -904,9 +904,7 @@ isccc_cc_lookupstring(isccc_sexpr_t *alist, const char *key, char **strp) {
|
|||
if (kv != NULL) {
|
||||
v = ISCCC_SEXPR_CDR(kv);
|
||||
if (isccc_sexpr_binaryp(v)) {
|
||||
if (strp != NULL) {
|
||||
*strp = isccc_sexpr_tostring(v);
|
||||
}
|
||||
SET_IF_NOT_NULL(strp, isccc_sexpr_tostring(v));
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
return ISC_R_EXISTS;
|
||||
|
|
@ -924,10 +922,9 @@ isccc_cc_lookupuint32(isccc_sexpr_t *alist, const char *key, uint32_t *uintp) {
|
|||
if (kv != NULL) {
|
||||
v = ISCCC_SEXPR_CDR(kv);
|
||||
if (isccc_sexpr_binaryp(v)) {
|
||||
if (uintp != NULL) {
|
||||
*uintp = (uint32_t)strtoul(
|
||||
isccc_sexpr_tostring(v), NULL, 10);
|
||||
}
|
||||
SET_IF_NOT_NULL(uintp, (uint32_t)strtoul(
|
||||
isccc_sexpr_tostring(v),
|
||||
NULL, 10));
|
||||
return ISC_R_SUCCESS;
|
||||
} else {
|
||||
return ISC_R_EXISTS;
|
||||
|
|
|
|||
|
|
@ -102,9 +102,7 @@ get_acl_def(const cfg_obj_t *cctx, const char *name, const cfg_obj_t **ret) {
|
|||
const char *aclname =
|
||||
cfg_obj_asstring(cfg_tuple_get(acl, "name"));
|
||||
if (strcasecmp(aclname, name) == 0) {
|
||||
if (ret != NULL) {
|
||||
*ret = cfg_tuple_get(acl, "value");
|
||||
}
|
||||
SET_IF_NOT_NULL(ret, cfg_tuple_get(acl, "value"));
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
@ -210,9 +208,7 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx,
|
|||
const cfg_obj_t *negated = cfg_tuple_get(ce, "negated");
|
||||
if (!cfg_obj_isvoid(negated)) {
|
||||
ce = negated;
|
||||
if (has_negative != NULL) {
|
||||
*has_negative = true;
|
||||
}
|
||||
SET_IF_NOT_NULL(has_negative, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue