Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dfca092

Browse files
author
Julian Assange
committed
applied kurt's patch to fix unlikely, but potential, string underflow
problem in psql
1 parent ab57e09 commit dfca092

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/psql/stringutils.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.2 1996/07/28 07:08:15 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.3 1996/08/06 20:23:14 julian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -42,7 +42,7 @@ char *rightTrim(char *s)
4242
{
4343
char *sEnd;
4444
sEnd = s+strlen(s)-1;
45-
while (isspace(*sEnd))
45+
while (sEnd >= s && isspace(*sEnd))
4646
sEnd--;
4747
if (sEnd < s)
4848
s[0]='\0';

0 commit comments

Comments
 (0)