Files
operating-system/buildroot/package/mini-snmpd/0001-Prepend-zero-byte-before-unsigned-integers.patch
Pascal Vizeli 41d3f59002 Update Buildroot to 2019.02.3 (#415)
* Update Buildroot to 2019-02.3

* Fix enter script

* Update ova_defconfig

* Fix network manager

* Remove runc patches

* Use same docker version

* Fix build

* Fix vmtools

* Fix depens

* Fix handling with tempfiles

* Fix permission handling

* Fix cp

* Cleanup

* Fix mounts
2019-06-27 11:58:50 +02:00

32 lines
814 B
Diff

From 949ae648bf7c654b8fae607a0988bfa672607156 Mon Sep 17 00:00:00 2001
From: Patrick Rauscher <prauscher@prauscher.de>
Date: Fri, 18 Aug 2017 17:31:23 +0200
Subject: [PATCH] Prepend zero-byte before unsigned integers
fixes #8
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
mib.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mib.c b/mib.c
index 7d2e513..a9ffbe2 100644
--- a/mib.c
+++ b/mib.c
@@ -207,6 +207,11 @@ static int encode_unsigned(data_t *data, int type, unsigned int ticks_value)
else
length = 1;
+ /* check if the integer could be interpreted negative during a signed decode and prepend a zero-byte if necessary */
+ if ((ticks_value >> (8 * (length - 1))) & 0x80) {
+ length++;
+ }
+
*buffer++ = type;
*buffer++ = length;
while (length--)
--
2.13.2