Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19a08ef
)
Fix psql crash while parsing SQL file whose encoding is different from
author
Tatsuo Ishii
<ishii@postgresql.org>
Sun, 2 Dec 2012 12:11:15 +0000
(21:11 +0900)
committer
Tatsuo Ishii
<ishii@postgresql.org>
Sun, 2 Dec 2012 12:21:01 +0000
(21:21 +0900)
client encoding and the client encoding is not *safe* one. Such an
example is, file encoding is UTF-8 and client encoding SJIS. Patch
contributed by Jiang Guiqing.
src/bin/psql/psqlscan.l
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/psql/psqlscan.l
b/src/bin/psql/psqlscan.l
index 1208c8f475cac29ff38016d0ef867682e9a3a7d9..a3d569f13dbedf6895955dd68524f8f998b5084f 100644
(file)
--- a/
src/bin/psql/psqlscan.l
+++ b/
src/bin/psql/psqlscan.l
@@
-1807,7
+1807,7
@@
prepare_buffer(const char *txt, int len, char **txtcopy)
/* first byte should always be okay... */
newtxt[i] = txt[i];
i++;
- while (--thislen > 0)
+ while (--thislen > 0
&& i < len
)
newtxt[i++] = (char) 0xFF;
}
}