mirror of
https://github.com/bgp/bgpq4
synced 2025-02-28 08:53:11 +00:00
correct handling for too large sources list
This commit is contained in:
4
CHANGES
4
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)
|
0.1.35-rc2 (2017-06-14)
|
||||||
- OpenBSD need <sys/select.h>. Reported by Denis Fondras.
|
- OpenBSD need <sys/select.h>. Reported by Denis Fondras.
|
||||||
- OpenBGPD output shall not emit 'deny any from any' in case of empty
|
- OpenBGPD output shall not emit 'deny any from any' in case of empty
|
||||||
|
|||||||
@@ -769,12 +769,15 @@ bgpq_expand(struct bgpq_expander* b)
|
|||||||
};
|
};
|
||||||
|
|
||||||
if(b->sources && b->sources[0]!=0) {
|
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);
|
snprintf(sources,sizeof(sources),"!s%s\n", b->sources);
|
||||||
SX_DEBUG(debug_expander,"Requesting sources %s", sources);
|
SX_DEBUG(debug_expander,"Requesting sources %s", sources);
|
||||||
write(fd, sources, strlen(sources));
|
write(fd, sources, strlen(sources));
|
||||||
memset(sources, 0, sizeof(sources));
|
memset(sources, 0, slen);
|
||||||
read(fd, sources, sizeof(sources));
|
read(fd, sources, slen);
|
||||||
SX_DEBUG(debug_expander,"Got answer %s", sources);
|
SX_DEBUG(debug_expander,"Got answer %s", sources);
|
||||||
if(sources[0]!='C') {
|
if(sources[0]!='C') {
|
||||||
sx_report(SX_ERROR, "Invalid source(s) '%s': %s\n", b->sources,
|
sx_report(SX_ERROR, "Invalid source(s) '%s': %s\n", b->sources,
|
||||||
|
|||||||
Reference in New Issue
Block a user