Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Convert-ASN1 CPAN distribution.

Report information
The Basics
Id: 15708
Status: resolved
Priority: 0/
Queue: Convert-ASN1

People
Owner: Nobody in particular
Requestors: javier.gutierrez
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Trailing bytes in an encoded file
Hallo dear Graham, I hope you are good. I've noticed that if you try to decode a file with trailing bytes (e.g. null bytes) Convert::ASN1 crashes. If I remove these unuseful bytes manually from the end of the file, it works. I've made a small patch to _decode.pm (attached). I've marked it with "# -->" and "# <--". Best regards. Javier GutiƩrrez

Message body is not shown because it is too large.

From: Graham Barr <gbarr [...] pobox.com>
Subject: Re: [cpan #15708] Trailing bytes in an encoded file
Date: Fri, 11 Nov 2005 20:38:29 -0600
To: bug-Convert-ASN1 [...] rt.cpan.org
RT-Send-Cc:
On Nov 11, 2005, at 10:20 AM, via RT wrote: Show quoted text
> I hope you are good. I've noticed that if you try to decode a file > with trailing bytes (e.g. null bytes) Convert::ASN1 crashes. If I > remove these unuseful bytes manually from the end of the file, it > works. > I've made a small patch to _decode.pm (attached). I've marked it > with "# -->" and "# <--".
It is very deliberate that decode fails if there are bytes left in the buffer. You should read from the file with the provided asn_read function, then those bytes would not get read as it will only read complete ASN packets. Graham.
[gbarr@pobox.com - Fri Nov 11 21:39:07 2005]: Show quoted text
> On Nov 11, 2005, at 10:20 AM, via RT wrote:
> > I hope you are good. I've noticed that if you try to decode a file > > with trailing bytes (e.g. null bytes) Convert::ASN1 crashes. If I > > remove these unuseful bytes manually from the end of the file, it > > works. > > I've made a small patch to _decode.pm (attached). I've marked it > > with "# -->" and "# <--".
> > It is very deliberate that decode fails if there are bytes left in > the buffer. You should read from the file with the provided asn_read > function, then those bytes would not get read as it will only read > complete ASN packets. > > Graham. >
great! thanks! Javier.