mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Forwardport checkin:
Fix a segfault when b"" was passed to b2a_qp() -- it was using strchr() instead of memchr().
This commit is contained in:
		
							parent
							
								
									3699582e03
								
							
						
					
					
						commit
						0925e419df
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1150,7 +1150,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
 | 
				
			||||||
	/* XXX: this function has the side effect of converting all of
 | 
						/* XXX: this function has the side effect of converting all of
 | 
				
			||||||
	 * the end of lines to be the same depending on this detection
 | 
						 * the end of lines to be the same depending on this detection
 | 
				
			||||||
	 * here */
 | 
						 * here */
 | 
				
			||||||
	p = (unsigned char *) strchr((char *)data, '\n');
 | 
						p = (unsigned char *) memchr(data, '\n', datalen);
 | 
				
			||||||
	if ((p != NULL) && (p > data) && (*(p-1) == '\r'))
 | 
						if ((p != NULL) && (p > data) && (*(p-1) == '\r'))
 | 
				
			||||||
		crlf = 1;
 | 
							crlf = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue