mirror of
				https://github.com/miekg/dns.git
				synced 2025-11-04 04:31:01 +01:00 
			
		
		
		
	* Add checks on data length for A and AAAA records Fixes panic when parsing A or AAAA records with no data * Add tests Field() on empty A/AAAA data * Refactor format test * Add return value check on format test
		
			
				
	
	
		
			17 lines
		
	
	
		
			279 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			279 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package dns
 | 
						|
 | 
						|
import (
 | 
						|
	"testing"
 | 
						|
)
 | 
						|
 | 
						|
func TestFieldEmptyAOrAAAAData(t *testing.T) {
 | 
						|
	res := Field(new(A), 1)
 | 
						|
	if res != "" {
 | 
						|
		t.Errorf("expected empty string but got %v", res)
 | 
						|
	}
 | 
						|
	res = Field(new(AAAA), 1)
 | 
						|
	if res != "" {
 | 
						|
		t.Errorf("expected empty string but got %v", res)
 | 
						|
	}
 | 
						|
}
 |