mirror of
https://github.com/bgp/bgpq4.git
synced 2024-05-11 05:55:05 +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)
|
||||
- OpenBSD need <sys/select.h>. Reported by Denis Fondras.
|
||||
- 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) {
|
||||
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,
|
||||
|
Reference in New Issue
Block a user