]> granicus.if.org Git - postgresql/commitdiff
applied kurt's patch to fix unlikely, but potential, string underflow
authorJulian Assange <proff@suburbia.net>
Tue, 6 Aug 1996 20:23:14 +0000 (20:23 +0000)
committerJulian Assange <proff@suburbia.net>
Tue, 6 Aug 1996 20:23:14 +0000 (20:23 +0000)
problem in psql

src/bin/psql/stringutils.c

index 294ce4017981f0fb919090446af39673562c44d7..daeb120ef9aa84b4502d8a27760ce9ec6aaacd1a 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * 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)
 {
   char *sEnd;
   sEnd = s+strlen(s)-1;
-  while (isspace(*sEnd))
+  while (sEnd >= s && isspace(*sEnd))
     sEnd--;
   if (sEnd < s)
     s[0]='\0';