glibc/glibc-fedora-nss-files-overflow-fix.patch

26 lines
839 B
Diff
Raw Normal View History

From f7001472d8d6ee9c5f83170c850a8a3b3ca0635f Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@redhat.com>
Date: Fri, 20 Aug 2010 17:04:03 +0200
Subject: [PATCH] Fix overflow in nss files parser
* nss/nss_files/files-XXX.c (internal_getent): Declare linebuflen
as size_t.
---
ChangeLog | 3 +++
nss/nss_files/files-XXX.c | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
--- a/nss/nss_files/files-XXX.c
+++ b/nss/nss_files/files-XXX.c
@@ -189,7 +189,7 @@ internal_getent (struct STRUCTURE *result,
{
char *p;
struct parser_data *data = (void *) buffer;
- int linebuflen = buffer + buflen - data->linebuffer;
+ size_t linebuflen = buffer + buflen - data->linebuffer;
int parse_result;
if (buflen < sizeof *data + 2)