aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-08 17:13:09 -0800
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:26 +0200
commit7ddc5b90f200d3df70ca744d35507799334a8d9e (patch)
tree13120e48d8c2f3b06cbd5691f87d98a70f0d7025 /nx-X11/lib
parente18ccaaae7fdf039114eb10e92d8339031530816 (diff)
downloadnx-libs-7ddc5b90f200d3df70ca744d35507799334a8d9e.tar.gz
nx-libs-7ddc5b90f200d3df70ca744d35507799334a8d9e.tar.bz2
nx-libs-7ddc5b90f200d3df70ca744d35507799334a8d9e.zip
_xudc_code_to_glyph: check for NULL pointer *before* writing to it, not after
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/X11/udcInf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nx-X11/lib/X11/udcInf.c b/nx-X11/lib/X11/udcInf.c
index afe398cc7..eeb847657 100644
--- a/nx-X11/lib/X11/udcInf.c
+++ b/nx-X11/lib/X11/udcInf.c
@@ -702,14 +702,14 @@ int *num_gi;
_XlcCloseConverter(conv);
_XlcDestroyLC(lcd);
- *gi = (_XUDCGIInf *)Xmalloc(sizeof(_XUDCGIInf));
- (*gi)->charset_str = (char *)Xmalloc(strlen(charsetname)+1);
- strcpy((*gi)->charset_str,charsetname);
- (*gi)->glyph_index = glyph;
+ *gi = Xmalloc(sizeof(_XUDCGIInf));
if(*gi == NULL){
_xudc_utyerrno = 0x03 ;
return(_XUDC_ERROR);
}
+ (*gi)->charset_str = Xmalloc(strlen(charsetname)+1);
+ strcpy((*gi)->charset_str,charsetname);
+ (*gi)->glyph_index = glyph;
*num_gi = 1;
return(0);
}