Fixed: Reading in a yang-spec file exactly the same size as the buffer (1024/2048/4096/...) could leave the buffer not terminated with a 0 byte
This commit is contained in:
parent
0adcd94f3f
commit
fade9dcfd5
3 changed files with 757 additions and 1 deletions
|
|
@ -554,7 +554,7 @@ yang_parse_file(int fd,
|
|||
}
|
||||
if (ret == 0)
|
||||
break; /* eof */
|
||||
if (len==i){
|
||||
if (i == len-1){
|
||||
if ((buf = realloc(buf, 2*len)) == NULL){
|
||||
clicon_err(OE_XML, errno, "realloc");
|
||||
goto done;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue