Blame SOURCES/authd-covscan.patch

f16fb0
diff --git a/authd.c b/authd.c
f16fb0
index a2072de..07c6f0d 100644
f16fb0
--- a/authd.c
f16fb0
+++ b/authd.c
f16fb0
@@ -240,7 +240,6 @@ static void create_opt(int argc, char *argv[]) {
f16fb0
     opt.passwd = vstrdup(DFL_PASSWD);
f16fb0
     if ((opt.mapped = calloc(HEX_LEN_MAX + sizeof '\0', sizeof(char))) == NULL)
f16fb0
         handle_error(NULL);
f16fb0
-    memset(opt.mapped, '0', HEX_LEN_MAX);
f16fb0
     opt.multiquery = 1;
f16fb0
     opt.timeout = UINT_MAX;
f16fb0
     while ((c = getopt_long(argc, argv, SHORT_OPTS, LONG_OPTS, &i)) != -1) {
f16fb0
@@ -539,7 +538,9 @@ static char *get_created_tok_addr(const char *peer_addr_hex) {
f16fb0
             }
f16fb0
             // hex addr must have even number of digits
f16fb0
             if ((int) z & 1) {
f16fb0
-                errno = EINVAL; return NULL;
f16fb0
+                free(addr);
f16fb0
+                errno = EINVAL;
f16fb0
+                return NULL;
f16fb0
             }
f16fb0
             while (z > 1) {
f16fb0
                 unsigned long ul; char *endptr;
f16fb0
@@ -548,7 +549,9 @@ static char *get_created_tok_addr(const char *peer_addr_hex) {
f16fb0
                 addr_hex[z] = '\0'; z -= HEX_DIG;
f16fb0
                 ul = strtoul(addr_hex + z, &endptr, 16);
f16fb0
                 if (is_bad_strto(addr_hex + z, endptr)) {
f16fb0
-                    errno = EINVAL; return NULL;
f16fb0
+                    free(addr); 
f16fb0
+                    errno = EINVAL;
f16fb0
+                    return NULL;
f16fb0
                 }
f16fb0
 	        if ((!IS_IPV4 || 6 == z) && is_16_bits)
f16fb0
                     *p++ = ':';
f16fb0
@@ -809,7 +812,7 @@ static bool initialize_crypto(crypto_t *x, const char *filename) {
f16fb0
         const EVP_MD *const HASH = EVP_md5();   // openssl compat: enc -pass
f16fb0
         const size_t KEY_SIZE = EVP_CIPHER_key_length(x->cipher);
f16fb0
         const size_t IV_SIZE = EVP_CIPHER_iv_length(x->cipher);
f16fb0
-        char *pass = NULL; size_t z = 0;
f16fb0
+        unsigned char *pass = NULL; size_t z = 0;
f16fb0
 
f16fb0
         if (!S_ISREG(file.st_mode)) return false;       // no dirs, devs, etc.
f16fb0
         if  (file.st_mode & (S_IROTH | S_IWOTH)) return false;  // no ------rw-