diff options
author | jsorg71 <jsorg71> | 2006-04-16 02:20:20 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2006-04-16 02:20:20 +0000 |
commit | eef98128fc36ffb5130efffd6c62417f98b0c702 (patch) | |
tree | c4007130caeac343099d702e5d416f02ffcd6017 /xrdp | |
parent | 8fd2618101c5559b694938427c7519e33ee3ea02 (diff) | |
download | xrdp-proprietary-eef98128fc36ffb5130efffd6c62417f98b0c702.tar.gz xrdp-proprietary-eef98128fc36ffb5130efffd6c62417f98b0c702.zip |
bounds check when loading font
Diffstat (limited to 'xrdp')
-rw-r--r-- | xrdp/xrdp_font.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xrdp/xrdp_font.c b/xrdp/xrdp_font.c index 6cb93930..67bf268a 100644 --- a/xrdp/xrdp_font.c +++ b/xrdp/xrdp_font.c @@ -108,6 +108,13 @@ xrdp_font_create(struct xrdp_wm* wm) f->incby = i; in_uint8s(s, 6); datasize = FONT_DATASIZE(f); + if (datasize < 0 || datasize > 512) + { + /* shouldn't happen */ + g_writeln("error in xrdp_font_create, datasize wrong"); + g_writeln("%d %d %d", f->width, f->height, datasize); + break; + } if (s_check_rem(s, datasize)) { f->data = (char*)g_malloc(datasize, 0); |