dix: make RegionInit legal C++
The CVE fix in:
    commit 97015a07b9
    Author: Alan Coopersmith <alan.coopersmith@oracle.com>
    Date:   Wed Jan 22 22:37:15 2014 -0800
        dix: integer overflow in RegionSizeof() [CVE-2014-8092 3/4]
offended the C++ demons:
../../include/regionstr.h:147:45: error: invalid conversion from 'void*' to
'pixman_region16_data_t* {aka pixman_region16_data*}' [-fpermissive]
Normally this isn't a problem, because around here we have the sense and
common decency to not use C++, but this does make tigervnc fail to build,
which is a little rude of us.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
			
			
This commit is contained in:
		
							parent
							
								
									0829310148
								
							
						
					
					
						commit
						bb23fbf5bb
					
				| 
						 | 
					@ -144,7 +144,7 @@ RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size)
 | 
				
			||||||
        size_t rgnSize;
 | 
					        size_t rgnSize;
 | 
				
			||||||
        (_pReg)->extents = RegionEmptyBox;
 | 
					        (_pReg)->extents = RegionEmptyBox;
 | 
				
			||||||
        if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) &&
 | 
					        if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) &&
 | 
				
			||||||
            (((_pReg)->data = malloc(rgnSize)) != NULL)) {
 | 
					            (((_pReg)->data = (RegDataPtr) malloc(rgnSize)) != NULL)) {
 | 
				
			||||||
            (_pReg)->data->size = (_size);
 | 
					            (_pReg)->data->size = (_size);
 | 
				
			||||||
            (_pReg)->data->numRects = 0;
 | 
					            (_pReg)->data->numRects = 0;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue