The Samba-Bugzilla – Attachment 6484 Details for
Bug 8163
asn.1 library does not correctly read negative integers.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 3.6.0
0001-Fix-our-asn.1-parser-to-handle-negative-numbers.patch (text/plain), 1.13 KB, created by
Jeremy Allison
on 2011-05-24 22:22:14 UTC
(
hide
)
Description:
git-am fix for 3.6.0
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2011-05-24 22:22:14 UTC
Size:
1.13 KB
patch
obsolete
>From a9254891ea8a71fdbd0599425ef16664bf035679 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Tue, 24 May 2011 12:47:31 -0700 >Subject: [PATCH] Fix our asn.1 parser to handle negative numbers. > >Autobuild-User: Jeremy Allison <jra@samba.org> >Autobuild-Date: Tue May 24 22:57:16 CEST 2011 on sn-devel-104 >(cherry picked from commit e719dfd4dc178f001a5f804fb1ac4e587574415f) >--- > lib/util/asn1.c | 9 +++++++++ > 1 files changed, 9 insertions(+), 0 deletions(-) > >diff --git a/lib/util/asn1.c b/lib/util/asn1.c >index b716da6..c23bf65 100644 >--- a/lib/util/asn1.c >+++ b/lib/util/asn1.c >@@ -885,10 +885,19 @@ bool asn1_read_ContextSimple(struct asn1_data *data, uint8_t num, DATA_BLOB *blo > bool asn1_read_implicit_Integer(struct asn1_data *data, int *i) > { > uint8_t b; >+ bool first_byte = true; > *i = 0; > > while (!data->has_error && asn1_tag_remaining(data)>0) { > if (!asn1_read_uint8(data, &b)) return false; >+ if (first_byte) { >+ if (b & 0x80) { >+ /* Number is negative. >+ Set i to -1 for sign extend. */ >+ *i = -1; >+ } >+ first_byte = false; >+ } > *i = (*i << 8) + b; > } > return !data->has_error; >-- >1.7.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
abartlet
:
review+
Actions:
View
Attachments on
bug 8163
: 6484