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

Commit95eb4cd

Browse files
committed
Avoid possible segfault in psql's tab completion.
Fix oversight inbd1276a: the "words_after_create" stanza inpsql_completion() requires previous_words_count > 0, since it usesprev_wd. This condition was formerly assured by the if-else chainabove it, but no more. If there were no previous words then we'ddereference an uninitialized pointer, possibly causing a segfault.Report and patch by Anthonin Bonnefoy.Discussion:https://postgr.es/m/CAO6_XqrSRE7c_i+D7Hm07K3+6S0jTAmMr60RY41XzaA29Ae5uA@mail.gmail.com
1 parentfd64ed6 commit95eb4cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/bin/psql/tab-complete.in.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ psql_completion(const char *text, int start, int end)
20242024
* check if that was the previous word. If so, execute the query to get a
20252025
* list of them.
20262026
*/
2027-
if (matches==NULL)
2027+
if (matches==NULL&&previous_words_count>0)
20282028
{
20292029
constpgsql_thing_t*wac;
20302030

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp