Commit 390b3cb
committed
Protect against small overread in SASLprep validation
In case of torn UTF8 in the input data we might end up going
past the end of the string since we don't account for length.
While validation won't be performed on a sequence with a NULL
byte it's better to avoid going past the end to beging with.
Fix by taking the length into consideration.
Author: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CAOYmi+mTnmM172g=_+Yvc47hzzeAsYPy2C4UBY3HK9p-AXNV0g@mail.gmail.com1 parent 56fead4 commit 390b3cb
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1004 | 1004 | | |
1005 | 1005 | | |
1006 | 1006 | | |
| 1007 | + | |
1007 | 1008 | | |
1008 | | - | |
| 1009 | + | |
1009 | 1010 | | |
1010 | 1011 | | |
1011 | 1012 | | |
1012 | | - | |
| 1013 | + | |
1013 | 1014 | | |
1014 | 1015 | | |
1015 | 1016 | | |
| 1017 | + | |
1016 | 1018 | | |
1017 | 1019 | | |
1018 | 1020 | | |
| |||
0 commit comments