Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc851884

Browse files
committed
Unbreak \h; can't do strlen(NULL).
This was broken by the following commmit. Although the original commit wasbackpatched all the way to 7.4, this particular bug exists only in the versionapplied to HEAD.http://archives.postgresql.org/pgsql-committers/2010-05/msg00058.php
1 parent15ab0e9 commitc851884

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎src/bin/psql/command.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.219 2010/05/08 16:39:51 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.220 2010/05/21 17:37:44 rhaas Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"command.h"
@@ -654,10 +654,14 @@ exec_command(const char *cmd,
654654
size_tlen;
655655

656656
/* strip any trailing spaces and semicolons */
657-
len=strlen(opt);
658-
while (len>0&&
659-
(isspace((unsignedchar)opt[len-1])||opt[len-1]==';'))
660-
opt[--len]='\0';
657+
if (opt)
658+
{
659+
len=strlen(opt);
660+
while (len>0&&
661+
(isspace((unsignedchar)opt[len-1])
662+
||opt[len-1]==';'))
663+
opt[--len]='\0';
664+
}
661665

662666
helpSQL(opt,pset.popt.topt.pager);
663667
free(opt);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp