mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 16:21:06 +00:00
Fix return value of puts for very long strings.
This commit is contained in:
parent
67854c131c
commit
cc88b371a5
@ -1,5 +1,9 @@
|
||||
2009-10-29 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
[BZ #10780]
|
||||
* libio/ioputs.c (_IO_puts): Make sure to not return a number which
|
||||
overflows the int return type.
|
||||
|
||||
[BZ #10717]
|
||||
* malloc/memusagestat.c (main): Fix repairing of trace files. We also
|
||||
have to compute maxsize_total, we have to update the variables, and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1993,1996,1997,1998,1999,2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993,1996-1999,2003,2009 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -27,6 +27,7 @@
|
||||
|
||||
#include "libioP.h"
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
int
|
||||
_IO_puts (str)
|
||||
@ -40,7 +41,7 @@ _IO_puts (str)
|
||||
|| _IO_fwide (_IO_stdout, -1) == -1)
|
||||
&& _IO_sputn (_IO_stdout, str, len) == len
|
||||
&& _IO_putc_unlocked ('\n', _IO_stdout) != EOF)
|
||||
result = len + 1;
|
||||
result = MIN (INT_MAX, len + 1);
|
||||
|
||||
_IO_release_lock (_IO_stdout);
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user