Fix possible http module panic
https://github.com/zmap/zgrab2/pull/327
Cette révision appartient à :
Parent
00fe9ca9af
révision
c9a9ac1df0
|
@ -550,6 +550,12 @@ func (scan *scan) Grab() *zgrab2.ScanError {
|
|||
if readLen < sliceLen {
|
||||
sliceLen = readLen
|
||||
}
|
||||
|
||||
bodyTextLen := int64(len(bodyText))
|
||||
if bodyTextLen < sliceLen {
|
||||
sliceLen = bodyTextLen
|
||||
}
|
||||
|
||||
sliceBuf := bodyText[:sliceLen]
|
||||
if strings.Contains(sliceBuf, "The plain HTTP request was sent to HTTPS port") ||
|
||||
strings.Contains(sliceBuf, "You're speaking plain HTTP") ||
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket