Skip to content

Commit

Permalink
Merge pull request #241 from ngie-eign/coverity-fixes
Browse files Browse the repository at this point in the history
Address several issues with the ultimate goal being to fix Coverity cited problems
  • Loading branch information
wtoorop authored Jul 12, 2024
2 parents 70f2dbd + 388e124 commit 2e02581
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/compat/strlcpy.lo
/compat/timegm.o
/compat/timegm.lo
/compile
/config.guess
/config.h
/config.log
Expand Down Expand Up @@ -158,10 +159,12 @@
/ldns/config.h
/ldns/config.h.in
/ldns/net.h
/ldns/stamp-h1
/ldns/util.h
/ldns_wrapper.lo
/ldns_wrapper.o
/lib
/libdns.doxygen
/libldns.la
/libtool
/linktest
Expand All @@ -170,6 +173,7 @@
/ltmain.sh
/m4/lt*.m4
/m4/libtool.m4
/missing
/net.lo
/net.o
/packaging/ldns-config
Expand Down
2 changes: 1 addition & 1 deletion README.snapshots
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ ldns - snapshot releases
Snapshot releases are not official released. They can be released to
interested parties for development.

Snapshots can be recognized from the date in the the tar file name.
Snapshots can be recognized from the date in the tar file name.

They should not be used for packaging in distributions.
4 changes: 2 additions & 2 deletions dane.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,10 @@ ldns_dane_match_any_cert_with_data(STACK_OF(X509)* chain,
ldns_rdf* data, bool ca)
{
ldns_status s = LDNS_STATUS_DANE_TLSA_DID_NOT_MATCH;
size_t n, i;
int n, i;
X509* cert;

n = (size_t)sk_X509_num(chain);
n = sk_X509_num(chain);
for (i = 0; i < n; i++) {
cert = sk_X509_pop(chain);
if (! cert) {
Expand Down
8 changes: 5 additions & 3 deletions dnssec.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ ldns_create_nsec(ldns_rdf *cur_owner, ldns_rdf *next_owner, ldns_rr_list *rrs)
{
/* we do not do any check here - garbage in, garbage out */

/* the the start and end names - get the type from the
/* the start and end names - get the type from the
* before rrlist */

/* inefficient, just give it a name, a next name, and a list of rrs */
Expand Down Expand Up @@ -1836,8 +1836,10 @@ ldns_convert_dsa_rrsig_rdf2asn1(ldns_buffer *target_buffer,
return LDNS_STATUS_MEM_ERR;
}
# ifdef HAVE_DSA_SIG_SET0
if (! DSA_SIG_set0(dsasig, R, S))
return LDNS_STATUS_SSL_ERR;
if (! DSA_SIG_set0(dsasig, R, S)) {
DSA_SIG_free(dsasig);
return LDNS_STATUS_SSL_ERR;
}
# else
dsasig->r = R;
dsasig->s = S;
Expand Down
6 changes: 3 additions & 3 deletions ldns/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ssize_t ldns_bget_token(ldns_buffer *b, char *token, const char *delim, size_t l
* \param[in] k_del keyword delimiter
* \param[out] data the data found
* \param[in] d_del the data delimiter
* \param[in] data_limit maximum size the the data buffer
* \param[in] data_limit maximum size the data buffer
* \return the number of character read
*/
ssize_t ldns_fget_keyword_data(FILE *f, const char *keyword, const char *k_del, char *data, const char *d_del, size_t data_limit);
Expand All @@ -144,7 +144,7 @@ ssize_t ldns_fget_keyword_data(FILE *f, const char *keyword, const char *k_del,
* \param[in] k_del keyword delimiter
* \param[out] data the data found
* \param[in] d_del the data delimiter
* \param[in] data_limit maximum size the the data buffer
* \param[in] data_limit maximum size the data buffer
* \param[in] line_nr pointer to an integer containing the current line number (for
debugging purposes)
* \return the number of character read
Expand All @@ -159,7 +159,7 @@ ssize_t ldns_fget_keyword_data_l(FILE *f, const char *keyword, const char *k_del
* \param[in] k_del keyword delimiter
* \param[out] data the data found
* \param[in] d_del the data delimiter
* \param[in] data_limit maximum size the the data buffer
* \param[in] data_limit maximum size the data buffer
* \return the number of character read
*/
ssize_t ldns_bget_keyword_data(ldns_buffer *b, const char *keyword, const char *k_del, char *data, const char *d_del, size_t data_limit);
Expand Down
2 changes: 1 addition & 1 deletion ldns/radix.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct ldns_radix_node_t {
void* data;
/** Parent node. */
ldns_radix_node_t* parent;
/** Index in the the parent node select edge array. */
/** Index in the parent node select edge array. */
uint8_t parent_index;
/** Length of the array. */
uint16_t len;
Expand Down
2 changes: 1 addition & 1 deletion ldns/rdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ size_t ldns_rdf_size(const ldns_rdf *rd);

/**
* returns the type of the rdf. We need to insert _get_
* here to prevent conflict the the rdf_type TYPE.
* here to prevent conflict the rdf_type TYPE.
* \param[in] *rd the rdf to read from
* \return ldns_rdf_type with the type
*/
Expand Down
2 changes: 1 addition & 1 deletion lua/rns-specs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ freedom in the packet mangling. (ghe ghe :-) )

To keep matters interesting some sort of randomness is required in some
step, otherwise each packet is mangled in the same way. Also this
randomness together with the Lua script needs to be logged so the the
randomness together with the Lua script needs to be logged so the
actual mangling can be replayed.

:Packet Mangling: address the different elements:
Expand Down
2 changes: 1 addition & 1 deletion pcat/pcat-diff.1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pcat-diff \- show the difference between two pcat files.

.SH DESCRIPTION
\fBpcat-diff\fR reads in two pcat files and show the differences
between the them.
between them.
Its output is another pcat stream which can then be interpreted by
pcat-print.

Expand Down

0 comments on commit 2e02581

Please sign in to comment.