diff options
Diffstat (limited to 'prog/target.go')
| -rw-r--r-- | prog/target.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/prog/target.go b/prog/target.go index 08495f1f2..56c2a94ca 100644 --- a/prog/target.go +++ b/prog/target.go @@ -54,6 +54,9 @@ type Target struct { // Additional special invalid pointer values besides NULL to use. SpecialPointers []uint64 + // Special file name length that can provoke bugs (e.g. PATH_MAX). + SpecialFileLenghts []int + // Filled by prog package: SyscallMap map[string]*Syscall ConstMap map[string]uint64 @@ -132,6 +135,15 @@ func (target *Target) lazyInit() { if len(target.SpecialPointers) > maxSpecialPointers { panic("too many special pointers") } + if len(target.SpecialFileLenghts) == 0 { + // Just some common lengths that can be used as PATH_MAX/MAX_NAME. + target.SpecialFileLenghts = []int{256, 512, 4096} + } + for _, ln := range target.SpecialFileLenghts { + if ln <= 0 || ln >= memAllocMaxMem { + panic(fmt.Sprintf("bad special file length %v", ln)) + } + } // These are used only during lazyInit. target.ConstMap = nil target.types = nil |
