roken: Fix base64(1) crash on empty file
This commit is contained in:
@@ -241,7 +241,7 @@ main(int argc, char **argv)
|
|||||||
if (fwrite(d, ret, 1, stdout) != 1)
|
if (fwrite(d, ret, 1, stdout) != 1)
|
||||||
err(1, "Could not write decoded data");
|
err(1, "Could not write decoded data");
|
||||||
free(d);
|
free(d);
|
||||||
} else {
|
} else if (buf) { /* buf can be NULL if we read from an empty file */
|
||||||
char *e;
|
char *e;
|
||||||
|
|
||||||
if ((ret = rk_base64_encode(buf, buflen, &e)) < 0)
|
if ((ret = rk_base64_encode(buf, buflen, &e)) < 0)
|
||||||
|
Reference in New Issue
Block a user