mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	ci: fuzz: skip fuzz data that contains import (#3214)
				
					
				
			Thus far the fuzzers have found a few crashers in the Caddyfile parser. However, the fuzzer have been stuck at import glob expansion after import glob expansion, which aren't reproducible.
This commit is contained in:
		
							parent
							
								
									7ca15861dd
								
							
						
					
					
						commit
						3634c4593f
					
				@ -16,7 +16,12 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
package caddyfile
 | 
					package caddyfile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "bytes"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func FuzzParseCaddyfile(data []byte) (score int) {
 | 
					func FuzzParseCaddyfile(data []byte) (score int) {
 | 
				
			||||||
 | 
						if bytes.Contains(data, []byte("import")) {
 | 
				
			||||||
 | 
							return -1
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	sb, err := Parse("Caddyfile", data)
 | 
						sb, err := Parse("Caddyfile", data)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		// if both an error is received and some ServerBlocks,
 | 
							// if both an error is received and some ServerBlocks,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user