Skip to content

Commit

Permalink
server: check an array out of range for malform packet (pingcap#2048)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored Nov 21, 2016
1 parent af5b0e7 commit 6b444f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/conn_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ func parseStmtArgs(args []interface{}, boundParams [][]byte, nullBitmap, paramTy
continue
}

if (i<<1)+1 >= len(paramTypes) {
return mysql.ErrMalformPacket
}

tp := paramTypes[i<<1]
isUnsigned := (paramTypes[(i<<1)+1] & 0x80) > 0

Expand Down

0 comments on commit 6b444f8

Please sign in to comment.