Menu

#1 Buffer overflow

open
nobody
None
5
2006-05-29
2006-05-29
No

ScreenVideo *newScreenVideo(int width, int height, int
blockSize) {

imageSize = sizeof\(struct BGR\) \* width \* height;
video->image = \(struct BGR \*\)malloc\(imageSize\);
memset\(video->image, 0, imageSize\);

video->framebuf = \(unsigned char \*\)malloc\(imageSize \*

1.5);

I think that memset function should clear
video->framebuf buffer instead video->image.

memset\(video->image, 0, imageSize \* 1.5\);

video->frameSize = 0;

return video;

}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB