mirror of
				https://github.com/mozilla/gecko-dev.git
				synced 2025-10-31 16:28:05 +02:00 
			
		
		
		
	 a1aecf2da2
			
		
	
	
		a1aecf2da2
		
	
	
	
	
		
			
			Check for null pointers being passed as arguments to C string functions. There are no clang-analyzer-unix.cstring.NullArg warnings in mozilla-central! strlen strnlen strcpy strncpy strcat strncat strcmp strncmp strcasecmp strncasecmp https://clang-analyzer.llvm.org/available_checks.html MozReview-Commit-ID: EkfaItfo5cu --HG-- extra : source : e05c6cfa3b8ae6b3234ebf5e4895475bc623edcd extra : histedit_source : 6aa97bb8d82884fb2ac92793df9defd7a7985e89
		
			
				
	
	
		
			14 lines
		
	
	
	
		
			219 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
	
		
			219 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| // https://clang-analyzer.llvm.org/available_checks.html
 | |
| 
 | |
| #include "structures.h"
 | |
| 
 | |
| int my_strlen(const char* s)
 | |
| {
 | |
|   return strlen(s); // warning
 | |
| }
 | |
| 
 | |
| int bad_caller()
 | |
| {
 | |
|   const char* s = nullptr;
 | |
|   return my_strlen(s);
 | |
| }
 |