check for failues for hex_encode, cid#159
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24151 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1447,11 +1447,13 @@ hxtool_hex(struct hex_options *opt, int argc, char **argv)
|
|||||||
errx(1, "fwrite failed");
|
errx(1, "fwrite failed");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
char buf[28], *p;
|
char buf[28], *p;
|
||||||
size_t len;
|
ssize_t len;
|
||||||
|
|
||||||
while((len = fread(buf, 1, sizeof(buf), stdin)) != 0) {
|
while((len = fread(buf, 1, sizeof(buf), stdin)) != 0) {
|
||||||
len = hex_encode(buf, len, &p);
|
len = hex_encode(buf, len, &p);
|
||||||
|
if (len < 0)
|
||||||
|
continue;
|
||||||
fprintf(stdout, "%s\n", p);
|
fprintf(stdout, "%s\n", p);
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user