We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73fae13 commit d14b733Copy full SHA for d14b733
base/socket.jl
@@ -144,8 +144,14 @@ function parse_ipv4(str)
144
end
145
if f[1] == '0'
146
if length(f) >= 2 && f[2] == 'x'
147
+ if length(f) > 8 # 2+(3*2) - prevent parseint from overflowing on 32bit
148
+ error("IPv4 field too large")
149
+ end
150
r = parseint(f[3:end],16)
151
else
152
+ if length(f) > 9 # 1+8 - prevent parseint from overflowing on 32bit
153
154
155
r = parseint(f,8)
156
157
@@ -157,7 +163,7 @@ function parse_ipv4(str)
163
158
164
ret |= uint32(r) << ((4-i)*8)
159
165
160
- if r > ((uint64(1)<<((5-length(f))*8))-1)
166
+ if r > ((uint64(1)<<((5-length(fields))*8))-1)
161
167
error("IPv4 field too large")
162
168
169
ret |= r
0 commit comments