diff --git a/CHANGES b/CHANGES index e6c1a66..a55841f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +untagged yet (2017-07-19) + - too large (>124bytes) sources list was not handled correctly. + Reported by Pier Carlo Chiodi. + 0.1.35-rc2 (2017-06-14) - OpenBSD need . Reported by Denis Fondras. - OpenBGPD output shall not emit 'deny any from any' in case of empty diff --git a/bgpq_expander.c b/bgpq_expander.c index 1f79e70..c279182 100644 --- a/bgpq_expander.c +++ b/bgpq_expander.c @@ -769,12 +769,15 @@ bgpq_expand(struct bgpq_expander* b) }; if(b->sources && b->sources[0]!=0) { - char sources[128]; + int slen = strlen(b->sources)+4; + if (slen < 128) + slen = 128; + char sources[slen]; snprintf(sources,sizeof(sources),"!s%s\n", b->sources); SX_DEBUG(debug_expander,"Requesting sources %s", sources); write(fd, sources, strlen(sources)); - memset(sources, 0, sizeof(sources)); - read(fd, sources, sizeof(sources)); + memset(sources, 0, slen); + read(fd, sources, slen); SX_DEBUG(debug_expander,"Got answer %s", sources); if(sources[0]!='C') { sx_report(SX_ERROR, "Invalid source(s) '%s': %s\n", b->sources,