fix(verify): arm64 stack save, adaptive canary and host gating
Assisted-by: GLM 5.3
This commit is contained in:
@@ -115,6 +115,48 @@ func TestParseBufSpec(t *testing.T) {
|
||||
t.Error("ParseBufSpec(\"dst:0:zero\") should error on zero size")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("trailing-garbage-size", func(t *testing.T) {
|
||||
// fmt.Sscanf("%d") accepted "1024abc" as 1024; the strict parse
|
||||
// must reject the whole field.
|
||||
if _, err := ParseBufSpec("dst:1024abc:zero"); err == nil {
|
||||
t.Error("ParseBufSpec(\"dst:1024abc:zero\") should reject a size with trailing garbage")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("hex-size", func(t *testing.T) {
|
||||
if _, err := ParseBufSpec("dst:0x40:zero"); err == nil {
|
||||
t.Error("ParseBufSpec(\"dst:0x40:zero\") should reject a non-decimal size")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("unknown-pattern", func(t *testing.T) {
|
||||
if _, err := ParseBufSpec("dst:64:wibble"); err == nil {
|
||||
t.Error("ParseBufSpec(\"dst:64:wibble\") should reject an unknown pattern")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("bad-hex-pattern", func(t *testing.T) {
|
||||
if _, err := ParseBufSpec("dst:64:zz"); err == nil {
|
||||
t.Error("ParseBufSpec(\"dst:64:zz\") should reject undecodable hex")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("empty-pattern", func(t *testing.T) {
|
||||
if _, err := ParseBufSpec("dst:64:"); err == nil {
|
||||
t.Error("ParseBufSpec(\"dst:64:\") should reject an empty pattern")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("hex-pattern", func(t *testing.T) {
|
||||
specs, err := ParseBufSpec("dst:6:deadbeef")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(specs) != 1 || specs[0].Pattern != "deadbeef" {
|
||||
t.Errorf("ParseBufSpec(\"dst:6:deadbeef\") = %+v", specs)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestBufPoolBuildArgs(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user