Update of /cvsroot/tmux/tmux/compat
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv26338/compat
Modified Files:
imsg.c
Log Message:
malloc(0) may return NULL, so only assume that is an error if allocating
more than zero.
Index: imsg.c
===================================================================
RCS file: /cvsroot/tmux/tmux/compat/imsg.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- imsg.c 6 Jun 2010 00:08:28 -0000 1.5
+++ imsg.c 11 Nov 2010 20:41:08 -0000 1.6
@@ -111,7 +111,7 @@
return (0);
datalen = imsg->hdr.len - IMSG_HEADER_SIZE;
ibuf->r.rptr = ibuf->r.buf + IMSG_HEADER_SIZE;
- if ((imsg->data = malloc(datalen)) == NULL)
+ if (datalen != 0 && (imsg->data = malloc(datalen + 1)) == NULL)
return (-1);
if (imsg->hdr.flags & IMSGF_HASFD)
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs