glx: Fix mask truncation in __glXGetAnswerBuffer [CVE-2014-8093 6/6]
On a system where sizeof(unsigned) != sizeof(intptr_t), the unary
bitwise not operation will result in a mask that clears all high bits
from temp_buf in the expression:
        temp_buf = (temp_buf + mask) & ~mask;
Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
			
			
This commit is contained in:
		
							parent
							
								
									e883c170c1
								
							
						
					
					
						commit
						7e7630bbb7
					
				|  | @ -73,7 +73,7 @@ __glXGetAnswerBuffer(__GLXclientState * cl, size_t required_size, | |||
|                      void *local_buffer, size_t local_size, unsigned alignment) | ||||
| { | ||||
|     void *buffer = local_buffer; | ||||
|     const unsigned mask = alignment - 1; | ||||
|     const intptr_t mask = alignment - 1; | ||||
| 
 | ||||
|     if (local_size < required_size) { | ||||
|         size_t worst_case_size; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue