Test against SSIZE_MAX as pointed out by enami tsugutomo.

This commit is contained in:
roy 2009-12-07 21:31:43 +00:00
parent 4d6a407bdd
commit c9c21f1ecc
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: getdelim.c,v 1.11 2009/12/02 11:14:47 roy Exp $ */
/* $NetBSD: getdelim.c,v 1.12 2009/12/07 21:31:43 roy Exp $ */
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: getdelim.c,v 1.11 2009/12/02 11:14:47 roy Exp $");
__RCSID("$NetBSD: getdelim.c,v 1.12 2009/12/07 21:31:43 roy Exp $");
#include "namespace.h"
@ -92,7 +92,7 @@ __getdelim(char **__restrict buf, size_t *__restrict buflen,
newlen = off + len;
/* Ensure we can handle it */
if (newlen < off || newlen > SIZE_MAX) {
if (newlen < off || newlen > SSIZE_MAX) {
errno = EOVERFLOW;
goto error;
}