]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- unbound-anchor review: BIO_write can return 0 successfully if it
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 15 Apr 2013 15:08:24 +0000 (15:08 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 15 Apr 2013 15:08:24 +0000 (15:08 +0000)
  has successfully appended a zero length string.

git-svn-id: file:///svn/unbound/trunk@2884 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
smallapp/unbound-anchor.c

index 6b931e996337ab9fd9c879cf6e775f5b0eceacbc..e0fd36427c70b67eae1c431818300455d1bcaf74 100644 (file)
@@ -1,6 +1,8 @@
 15 April 2013: Wouter
        - Fix so that for a configuration line of include: "*.conf" it is not
          an error if there are no files matching the glob pattern.
+       - unbound-anchor review: BIO_write can return 0 successfully if it
+         has successfully appended a zero length string.
 
 11 April 2013: Wouter
        - Fix queries leaking up for stubs and forwards, if the configured
index ef0031c94316bb4c88242f7b67af40de303c828e..2b6d4232b177e32f87708481c3167ec9a8574d21 100644 (file)
@@ -1231,7 +1231,7 @@ xml_charhandle(void *userData, const XML_Char *s, int len)
                printf("'\n");
        }
        if(strcasecmp(data->tag, "Zone") == 0) {
-               if(BIO_write(data->czone, s, len) <= 0) {
+               if(BIO_write(data->czone, s, len) < 0) {
                        if(verb) printf("out of memory in BIO_write\n");
                        exit(0);
                }
@@ -1242,7 +1242,7 @@ xml_charhandle(void *userData, const XML_Char *s, int len)
                return;
        b = xml_selectbio(data, data->tag);
        if(b) {
-               if(BIO_write(b, s, len) <= 0) {
+               if(BIO_write(b, s, len) < 0) {
                        if(verb) printf("out of memory in BIO_write\n");
                        exit(0);
                }
@@ -1435,7 +1435,7 @@ xml_startelem(void *userData, const XML_Char *name, const XML_Char **atts)
 static void
 xml_append_str(BIO* b, const char* s)
 {
-       if(BIO_write(b, s, (int)strlen(s)) <= 0) {
+       if(BIO_write(b, s, (int)strlen(s)) < 0) {
                if(verb) printf("out of memory in BIO_write\n");
                exit(0);
        }
@@ -1459,7 +1459,7 @@ xml_append_bio(BIO* b, BIO* a)
                        z[i] = ' ';
        }
        /* write to BIO */
-       if(BIO_write(b, z, len) <= 0) {
+       if(BIO_write(b, z, len) < 0) {
                if(verb) printf("out of memory in BIO_write\n");
                exit(0);
        }
@@ -1545,7 +1545,7 @@ xml_parse_setup(XML_Parser parser, struct xml_data* data, time_t now)
        }
        snprintf(buf, sizeof(buf), "; created by unbound-anchor on %s",
                ctime(&now));
-       if(BIO_write(data->ds, buf, (int)strlen(buf)) <= 0) {
+       if(BIO_write(data->ds, buf, (int)strlen(buf)) < 0) {
                if(verb) printf("out of memory\n");
                exit(0);
        }