mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-11-04 09:47:30 +03:00 
			
		
		
		
	Fixed unicode query conversion segfault.
This commit is contained in:
		
							parent
							
								
									2804f9a6a9
								
							
						
					
					
						commit
						5322b4e92f
					
				| 
						 | 
				
			
			@ -1,3 +1,9 @@
 | 
			
		|||
2005-05-31  Federico Di Gregorio  <fog@debian.org>
 | 
			
		||||
 | 
			
		||||
	* psycopg/cursor_type.c (_psyco_curs_execute): if a
 | 
			
		||||
	UnicodeEncodeError is raised during the converion of a unicode
 | 
			
		||||
	query we let it propagate insead of segfaulting.
 | 
			
		||||
	
 | 
			
		||||
2005-5-27  Federico Di Gregorio,  <fog@lana.initd.org>
 | 
			
		||||
 | 
			
		||||
	* tests/types_basic.py: fixed float and binary tests.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										6
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								NEWS
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -1,3 +1,9 @@
 | 
			
		|||
What's new in psycopg 2.0 beta 4
 | 
			
		||||
--------------------------------
 | 
			
		||||
 | 
			
		||||
* No more segfaults when a UNICODE query can't be converted to the
 | 
			
		||||
  backend encoding.
 | 
			
		||||
 | 
			
		||||
What's new in psycopg 2.0 beta 3
 | 
			
		||||
--------------------------------
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -245,6 +245,11 @@ _psyco_curs_execute(cursorObject *self,
 | 
			
		|||
        if (enc) {
 | 
			
		||||
            operation = PyUnicode_AsEncodedString(
 | 
			
		||||
                operation, PyString_AsString(enc), NULL);
 | 
			
		||||
 | 
			
		||||
            /* if there was an error during the encoding from unicode to the
 | 
			
		||||
               target encoding we just let the exception propagate */
 | 
			
		||||
            if (operation == NULL) return 0;
 | 
			
		||||
 | 
			
		||||
            /* we clone operation in uoperation to be sure to free it later */ 
 | 
			
		||||
            uoperation = operation;
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user