From: Sebastian Harl Date: Tue, 10 Dec 2013 08:11:53 +0000 (+0100) Subject: proto utils: Fixed offset check in get_int(). X-Git-Tag: sysdb-0.1.0~320 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=49f6d1d1aea28e246c10c04d90afc3fcf831ff9b proto utils: Fixed offset check in get_int(). --- diff --git a/src/utils/proto.c b/src/utils/proto.c index e9e3e6c..85a4cb8 100644 --- a/src/utils/proto.c +++ b/src/utils/proto.c @@ -106,7 +106,7 @@ sdb_proto_get_int(sdb_strbuf_t *buf, size_t offset) return UINT32_MAX; /* not enough data to read */ - if (offset + sizeof(uint32_t) < sdb_strbuf_len(buf)) + if (offset + sizeof(uint32_t) > sdb_strbuf_len(buf)) return UINT32_MAX; data = sdb_strbuf_string(buf);