From: Adam Heath Date: Thu, 19 Apr 2001 04:52:35 +0000 (+0000) Subject: If the buffer size is 0 in buffer_copy, then return, and do nothing. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bd125e548518018daf741c5815a9bcbaa4dd54e;p=dpkg If the buffer size is 0 in buffer_copy, then return, and do nothing. --- diff --git a/ChangeLog b/ChangeLog index 94f9d846..5a7a98f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -Wed Apr 18 13:15:08 CDT 2001 Adam Heath +Wed Apr 18 23:42:16 CDT 2001 Adam Heath + + * lib/mlib.c: If the buffer size is 0 in buffer_copy, then return, and + do nothing. + +Wed Apr 18 23:42:16 CDT 2001 Adam Heath * configure.in, debian/control: New upstream gettext. Since we had to change our build, to comply with the new upstream, we also diff --git a/lib/mlib.c b/lib/mlib.c index f741b60c..b7b8cca5 100644 --- a/lib/mlib.c +++ b/lib/mlib.c @@ -264,6 +264,8 @@ ssize_t buffer_copy(buffer_data_t read_data, buffer_data_t write_data, ssize_t l int bufsize= 32768; ssize_t totalread= 0, totalwritten= 0; if((limit != -1) && (limit < bufsize)) bufsize= limit; + if(bufsize == 0) + return 0; writebuf= buf= malloc(bufsize); if(buf== NULL) ohshite(_("failed to allocate buffer in buffer_copy (%s)"), desc);