summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-05-06 23:18:39 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2022-05-06 23:18:39 +0200
commit7c30a3763add5b789f5434b43bed750318d7254f (patch)
tree83bf2f27c1a178daa099e3ac111f8063a718b213
parent0.0.7 (diff)
downloadircxmpp-0.0.8.tar
ircxmpp-0.0.8.tar.gz
ircxmpp-0.0.8.tar.bz2
ircxmpp-0.0.8.tar.lz
ircxmpp-0.0.8.tar.xz
ircxmpp-0.0.8.tar.zst
ircxmpp-0.0.8.zip
-rw-r--r--debian/changelog10
-rw-r--r--dns.c6
-rw-r--r--ircxmpp.c4
3 files changed, 18 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 7e7cbbd..36d3ff4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+ircxmpp (0.0.8-1) stable; urgendcy=low
+
+ * it might be beneficiary to test if the program works before releasing
+ - tested compilers: tcc, gcc, clang
+ - scanned with scan-build and -fanalyzer
+ - ran with valgrind
+ - do not use 0.0.7
+
+ -- Anton Luka Šijanec <anton@sijanec.eu> Fri, 6 May 2022 23:00:00 +0200
+
ircxmpp (0.0.7-1) stable; urgency=low
* fixed obvious bug in dns server that breaks everything, DO NOT USE 0.0.6
diff --git a/dns.c b/dns.c
index 97ea778..8646339 100644
--- a/dns.c
+++ b/dns.c
@@ -106,6 +106,8 @@ static void dns_default_log_handler (void * const u __attribute__((unused)),
}
struct dns * dns_init (void) {
struct dns * dns = calloc(1, sizeof(struct dns));
+ if (!dns)
+ return NULL;
dns->fd = -1;
dns->domain = strdup(" call dns_set_domain to set the domain");
dns->domain[0] = strlen(dns->domain)-1;
@@ -217,12 +219,14 @@ static void dns_run_once (struct dns * dns) {
dns->log_handler(dns->log_userdata, DNS_ERROR, "dns", buf);
}
static void dns_free (struct dns * dns) {
+ if (!dns)
+ return;
if (dns->fd != -1)
close (dns->fd);
free(dns->domain);
free(dns);
}
-#if __INCLUDE_LEVEL__ == 0
+#if IX_DNS_MAIN
int shouldexit = 0;
void handler (int signal __attribute__((unused))) {
shouldexit++;
diff --git a/ircxmpp.c b/ircxmpp.c
index 09d9d46..aa23b8d 100644
--- a/ircxmpp.c
+++ b/ircxmpp.c
@@ -626,6 +626,8 @@ static void send_xmpp_logs_to_me (void * const u, const xmpp_log_level_t l, cons
struct ircxmpp * ircxmpp_init (void) {
xmpp_initialize();
struct ircxmpp * ircxmpp = calloc(1, sizeof(struct ircxmpp));
+ if (!ircxmpp)
+ return NULL;
ircxmpp->log_handler = default_log_handler;
ircxmpp->xmpp_logger.handler = send_xmpp_logs_to_me;
ircxmpp->xmpp_logger.userdata = ircxmpp;
@@ -772,7 +774,7 @@ int main (void) {
"multiple links can be specified by appending a consecutive number, starting with " \
"2, to every environment variable. first link is IX_*, second is IX_*2, and so on.\n"
size_t handles_length = 0;
- char * domain; // to know if we want to run dns server or not
+ char * domain = NULL; // to know if we want to run dns server or not
ircxmpp ** handles = NULL;
while (1) { // note that if input config is invalid we leak memory before exiting
char b[64]; // i don't free any allocated shit and just return, probably it's ok