[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: false asumption or security flaw?



You're creating a reference of type int (int &) with the value of 8 in a
roundabout kind of way. Yuck. That shouldn't dump core because it does
nothing wrong, but whatever you're trying to do I'll bet that isn't the
right way to do it :)


--
Tim Robbins
fyre@box3n.gumbynet.org

On Thu, 24 Aug 2000, johan '97 wrote:

> hi,
> 
> could anyone tell me why does this piece of code does not dump?
> <start>
> 
> #include <stdio.h>
> #include <stdlib.h>
> main()
> {
> 	int *x=(int*)malloc(sizeof(int));
> 	*x=8;
> 
> 	int &a=(*x);
> 
> 	printf("\na dan x : %d %d", a, *x);
> 
> 	a = 9;
> 
> 	printf("\na dan x : %d %d", a, *x);
> 
> 	free(x);
> 
> 	a=5;
> 
> 	return 0;
> }
> 
> <end>
> 
> could it be a security flaw in the kernel?
> 
> thanx
> 
> johan
> surrendered, i have
> 
> 
> Kernel-audit:  discussion list for security and the linux kernel
> Archive:       http://mail.nl.linux.org/kernel-audit/
> 


Kernel-audit:  discussion list for security and the linux kernel
Archive:       http://mail.nl.linux.org/kernel-audit/