mirror of
				https://github.com/SSLMate/certspotter.git
				synced 2025-07-03 10:47:17 +02:00 
			
		
		
		
	Avoid calling get-entries when range is invalid (end < begin)
end < begin can arise if we've rounded down end to avoid downloading a partial tile, but the log position is already within the partial tile (which can happen with a brand new log and -start_at_end).
This commit is contained in:
		
							parent
							
								
									a6af6c54ba
								
							
						
					
					
						commit
						71b296141e
					
				@ -418,11 +418,13 @@ func downloadWorker(ctx context.Context, config *Config, ctlog *loglist.Log, cli
 | 
				
			|||||||
		case batch = <-batchesIn:
 | 
							case batch = <-batchesIn:
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		entries, err := getEntriesFull(ctx, client, batch.begin, batch.end)
 | 
							if batch.end > batch.begin {
 | 
				
			||||||
		if err != nil {
 | 
								entries, err := getEntriesFull(ctx, client, batch.begin, batch.end)
 | 
				
			||||||
			return err
 | 
								if err != nil {
 | 
				
			||||||
 | 
									return err
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								batch.entries = entries
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		batch.entries = entries
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		select {
 | 
							select {
 | 
				
			||||||
		case <-ctx.Done():
 | 
							case <-ctx.Done():
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user