aboutsummaryrefslogtreecommitdiffstats
path: root/librecrypt_add_algorithm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--librecrypt_add_algorithm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/librecrypt_add_algorithm.c b/librecrypt_add_algorithm.c
index 920577d..4c6520e 100644
--- a/librecrypt_add_algorithm.c
+++ b/librecrypt_add_algorithm.c
@@ -67,8 +67,15 @@ librecrypt_add_algorithm(char *out_buffer, size_t size, const char *augend, cons
out_buffer[0u] = '\0';
}
} else {
+#if defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
if (!hashsize2)
goto out;
+#if defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
r_int = snprintf(NULL, 0u, "*%zu", hashsize2);
if (r_int < 2)
abort(); /* $covered$ (impossible reliably) */
@@ -126,7 +133,7 @@ librecrypt_add_algorithm(char *out_buffer, size_t size, const char *augend, cons
/* Chain the hash algorithms: write `augent` */
min = MIN(prefix1, size);
- if (out_buffer != augend)
+ if (out_buffer != augend && min)
memmove(out_buffer, augend, min);
out_buffer = &out_buffer[min];
size -= min;