Fix possible http module panic

https://github.com/zmap/zgrab2/pull/327
Cette révision appartient à :
vl4deee11 2021-10-12 21:44:05 +03:00 révisé par GitHub
Parent 00fe9ca9af
révision c9a9ac1df0
Signature inconnue de tcpd
ID de la clé GPG: 4AEE18F83AFDEB23

Voir le fichier

@ -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") ||