forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit504af1f
committed
Fix possible read past end of string in to_timestamp().
to_timestamp() handles the TH/th format codes by advancing over two inputcharacters, whatever those are. It failed to notice whether there weretwo characters available to be skipped, making it possible to advancethe pointer past the end of the input string and keep on parsing.A similar risk existed in the handling of "Y,YYY" format: it would advanceover three characters after the "," whether or not three characters wereavailable.In principle this might be exploitable to disclose contents of servermemory. But the security team concluded that it would be very hard to usethat way, because the parsing loop would stop upon hitting any zero byte,and TH/th format codes can't be consecutive --- they have to follow someother format code, which would have to match whatever data is there.So it seems impractical to examine memory very much beyond the end of theinput string via this bug; and the input string will always be in localmemory not in disk buffers, making it unlikely that anything veryinteresting is close to it in a predictable way. So this doesn't quiterise to the level of needing a CVE.Thanks to Wolf Roediger for reporting this bug.1 parent4edbb26 commit504af1f
1 file changed
+39
-45
lines changedLines changed: 39 additions & 45 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
964 | 964 |
| |
965 | 965 |
| |
966 | 966 |
| |
967 |
| - | |
968 | 967 |
| |
969 | 968 |
| |
970 | 969 |
| |
| |||
1976 | 1975 |
| |
1977 | 1976 |
| |
1978 | 1977 |
| |
| 1978 | + | |
| 1979 | + | |
1979 | 1980 |
| |
1980 | 1981 |
| |
1981 |
| - | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
1982 | 1991 |
| |
1983 | 1992 |
| |
1984 | 1993 |
| |
| |||
2086 | 2095 |
| |
2087 | 2096 |
| |
2088 | 2097 |
| |
2089 |
| - | |
2090 |
| - | |
2091 |
| - | |
2092 |
| - | |
2093 |
| - | |
2094 |
| - | |
2095 |
| - | |
2096 |
| - | |
2097 |
| - | |
2098 |
| - | |
2099 |
| - | |
2100 |
| - | |
2101 |
| - | |
2102 |
| - | |
2103 |
| - | |
2104 |
| - | |
2105 |
| - | |
2106 | 2098 |
| |
2107 | 2099 |
| |
2108 | 2100 |
| |
| |||
3000 | 2992 |
| |
3001 | 2993 |
| |
3002 | 2994 |
| |
3003 |
| - | |
| 2995 | + | |
3004 | 2996 |
| |
3005 | 2997 |
| |
3006 | 2998 |
| |
3007 |
| - | |
| 2999 | + | |
3008 | 3000 |
| |
3009 | 3001 |
| |
3010 | 3002 |
| |
3011 |
| - | |
| 3003 | + | |
3012 | 3004 |
| |
3013 | 3005 |
| |
3014 | 3006 |
| |
3015 |
| - | |
| 3007 | + | |
3016 | 3008 |
| |
3017 | 3009 |
| |
3018 | 3010 |
| |
| |||
3023 | 3015 |
| |
3024 | 3016 |
| |
3025 | 3017 |
| |
3026 |
| - | |
| 3018 | + | |
3027 | 3019 |
| |
3028 | 3020 |
| |
3029 | 3021 |
| |
| |||
3034 | 3026 |
| |
3035 | 3027 |
| |
3036 | 3028 |
| |
3037 |
| - | |
| 3029 | + | |
3038 | 3030 |
| |
3039 | 3031 |
| |
3040 | 3032 |
| |
3041 |
| - | |
| 3033 | + | |
3042 | 3034 |
| |
3043 | 3035 |
| |
3044 | 3036 |
| |
| |||
3078 | 3070 |
| |
3079 | 3071 |
| |
3080 | 3072 |
| |
3081 |
| - | |
| 3073 | + | |
3082 | 3074 |
| |
3083 | 3075 |
| |
3084 | 3076 |
| |
| |||
3098 | 3090 |
| |
3099 | 3091 |
| |
3100 | 3092 |
| |
3101 |
| - | |
| 3093 | + | |
3102 | 3094 |
| |
3103 | 3095 |
| |
3104 | 3096 |
| |
3105 |
| - | |
| 3097 | + | |
3106 | 3098 |
| |
3107 | 3099 |
| |
3108 | 3100 |
| |
3109 |
| - | |
| 3101 | + | |
3110 | 3102 |
| |
3111 | 3103 |
| |
3112 | 3104 |
| |
3113 |
| - | |
| 3105 | + | |
3114 | 3106 |
| |
3115 | 3107 |
| |
3116 | 3108 |
| |
3117 | 3109 |
| |
3118 | 3110 |
| |
3119 | 3111 |
| |
3120 |
| - | |
| 3112 | + | |
3121 | 3113 |
| |
3122 | 3114 |
| |
3123 | 3115 |
| |
3124 | 3116 |
| |
3125 |
| - | |
| 3117 | + | |
3126 | 3118 |
| |
3127 | 3119 |
| |
3128 | 3120 |
| |
| |||
3137 | 3129 |
| |
3138 | 3130 |
| |
3139 | 3131 |
| |
3140 |
| - | |
| 3132 | + | |
3141 | 3133 |
| |
3142 | 3134 |
| |
3143 | 3135 |
| |
3144 |
| - | |
| 3136 | + | |
3145 | 3137 |
| |
3146 | 3138 |
| |
3147 | 3139 |
| |
3148 | 3140 |
| |
3149 | 3141 |
| |
3150 |
| - | |
| 3142 | + | |
| 3143 | + | |
3151 | 3144 |
| |
3152 |
| - | |
3153 |
| - | |
| 3145 | + | |
| 3146 | + | |
3154 | 3147 |
| |
3155 | 3148 |
| |
3156 | 3149 |
| |
3157 | 3150 |
| |
3158 | 3151 |
| |
3159 | 3152 |
| |
3160 |
| - | |
| 3153 | + | |
| 3154 | + | |
3161 | 3155 |
| |
3162 | 3156 |
| |
3163 | 3157 |
| |
3164 | 3158 |
| |
3165 | 3159 |
| |
3166 | 3160 |
| |
3167 |
| - | |
| 3161 | + | |
3168 | 3162 |
| |
3169 | 3163 |
| |
3170 | 3164 |
| |
3171 | 3165 |
| |
3172 | 3166 |
| |
3173 | 3167 |
| |
3174 |
| - | |
| 3168 | + | |
3175 | 3169 |
| |
3176 | 3170 |
| |
3177 | 3171 |
| |
3178 | 3172 |
| |
3179 | 3173 |
| |
3180 | 3174 |
| |
3181 |
| - | |
| 3175 | + | |
3182 | 3176 |
| |
3183 | 3177 |
| |
3184 | 3178 |
| |
3185 | 3179 |
| |
3186 | 3180 |
| |
3187 | 3181 |
| |
3188 |
| - | |
| 3182 | + | |
3189 | 3183 |
| |
3190 | 3184 |
| |
3191 | 3185 |
| |
| |||
3199 | 3193 |
| |
3200 | 3194 |
| |
3201 | 3195 |
| |
3202 |
| - | |
| 3196 | + | |
3203 | 3197 |
| |
3204 | 3198 |
| |
3205 | 3199 |
| |
3206 |
| - | |
| 3200 | + | |
3207 | 3201 |
| |
3208 | 3202 |
| |
3209 | 3203 |
| |
|
0 commit comments
Comments
(0)