Commit dfca0926 authored by Julian Assange's avatar Julian Assange

applied kurt's patch to fix unlikely, but potential, string underflow

problem in psql
parent ab57e09e
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.2 1996/07/28 07:08:15 scrappy Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.3 1996/08/06 20:23:14 julian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -42,7 +42,7 @@ char *rightTrim(char *s) ...@@ -42,7 +42,7 @@ char *rightTrim(char *s)
{ {
char *sEnd; char *sEnd;
sEnd = s+strlen(s)-1; sEnd = s+strlen(s)-1;
while (isspace(*sEnd)) while (sEnd >= s && isspace(*sEnd))
sEnd--; sEnd--;
if (sEnd < s) if (sEnd < s)
s[0]='\0'; s[0]='\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment