summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2014-03-10 21:29:50 +0100
committerArthur de Jong <arthur@arthurdejong.org>2014-03-10 23:00:36 +0100
commit96e41711eee37ef3bd341690dff38867251b075f (patch)
treeada208ea473ba87c08921dec3335c4ff7f6544b6 /common
parent2d35feb2f94ec811b883a651ce61b8ee91ec47cf (diff)
Interpret transferred integers as signed again
This fixes an issue with unsigned values ending up in signed fields and missing sign extension. See: https://bugs.debian.org/739330
Diffstat (limited to 'common')
-rw-r--r--common/nslcd-prot.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/nslcd-prot.h b/common/nslcd-prot.h
index 70acd53..649be89 100644
--- a/common/nslcd-prot.h
+++ b/common/nslcd-prot.h
@@ -2,7 +2,7 @@
nslcd-prot.h - helper macros for reading and writing in protocol streams
Copyright (C) 2006 West Consulting
- Copyright (C) 2006, 2007, 2009, 2010, 2012, 2013 Arthur de Jong
+ Copyright (C) 2006-2014 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -170,7 +170,7 @@ static void debug_dump(const void *ptr, size_t size)
#define READ_INT32(fp, i) \
READ(fp, &tmpint32, sizeof(int32_t)); \
- (i) = ntohl(tmpint32); \
+ (i) = (int32_t)ntohl(tmpint32); \
DEBUG_PRINT("READ_INT32 : var="__STRING(i)" int32==%08x", (int)(i));
/* read a string in a fixed-size "normal" buffer */