projects
/
onak.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cscvs to tla changeset 57
[onak.git]
/
parsekey.c
diff --git
a/parsekey.c
b/parsekey.c
index a2ff57847e4cea077bfb8d8672a595d70cafa12a..4ec7ef3338a43d2d7a02502bbe02ab6f5d7d39cd 100644
(file)
--- a/
parsekey.c
+++ b/
parsekey.c
@@
-260,14
+260,21
@@
int read_openpgp_stream(int (*getchar_func)(void *ctx, size_t count,
break;
case 3:
fprintf(stderr, "Unsupported length type 3.\n");
break;
case 3:
fprintf(stderr, "Unsupported length type 3.\n");
+ curpacket->packet->length = 0;
+ curpacket->packet->data = NULL;
+ rc = -1;
break;
}
}
break;
}
}
- curpacket->packet->data =
- malloc(curpacket->packet->length *
+
+ if (rc == 0) {
+ curpacket->packet->data =
+ malloc(curpacket->packet->length *
sizeof(unsigned char));
sizeof(unsigned char));
- rc = getchar_func(ctx, curpacket->packet->length,
+ rc = getchar_func(ctx,
+ curpacket->packet->length,
curpacket->packet->data);
curpacket->packet->data);
+ }
inpacket = false;
} else {
fprintf(stderr, "Unexpected character: 0x%X\n",
inpacket = false;
} else {
fprintf(stderr, "Unexpected character: 0x%X\n",