Skip to content

Commit

Permalink
Correct the signature size check
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
  • Loading branch information
lcp authored and vathpela committed Jul 28, 2015
1 parent 8854461 commit 549d349
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/actions.c
Expand Up @@ -416,10 +416,9 @@ check_signature_space(pesign_context *ctx)
ssize_t available = available_cert_space(ctx->outpe);
ssize_t target = ctx->cms_ctx->newsig.len + sizeof (win_certificate);

if (available == target)
return;
target += ALIGNMENT_PADDING(target, 8);

if (target + 8 > available)
if (available >= target)
return;

fprintf(stderr, "Could not add new signature: insufficient space.\n");
Expand Down

0 comments on commit 549d349

Please sign in to comment.