diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-12-18 21:08:24 +0200 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-12-18 21:08:24 +0200 |
commit | 959a5e7d04375933eeb3d6d01be47ae445cf7582 (patch) | |
tree | 631601ae961775cdeca5a5ebf23a723b7eca0a9b /src | |
parent | d02c10ab990b7e2ddc8bf78815400d64e143a476 (diff) |
fixed the bug where randomly chart dimensions were hidden - it was caused due to unitialized use of allocated space
Diffstat (limited to 'src')
-rwxr-xr-x | src/main.c | 4 | ||||
-rwxr-xr-x | src/rrd2json.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c index c35dd71e3c..11d69cdb15 100755 --- a/src/main.c +++ b/src/main.c @@ -430,6 +430,10 @@ int main(int argc, char **argv) // catch all signals for (i = 1 ; i < 65 ;i++) { switch(i) { + case SIGKILL: // not catchable + case SIGSTOP: // not catchable + break; + case SIGSEGV: case SIGFPE: case SIGCHLD: diff --git a/src/rrd2json.c b/src/rrd2json.c index 675d158aea..028824dd7e 100755 --- a/src/rrd2json.c +++ b/src/rrd2json.c @@ -1082,6 +1082,13 @@ static RRDR *rrdr_create(RRDSET *st, int n) r->od = malloc(r->d * sizeof(uint8_t)); if(unlikely(!r->od)) goto cleanup; + // set the hidden flag on hidden dimensions + int c; + for(c = 0, rd = st->dimensions ; rd ; c++, rd = rd->next) { + if(unlikely(rd->flags & RRDDIM_FLAG_HIDDEN)) r->od[c] = RRDR_HIDDEN; + else r->od[c] = 0; + } + r->c = -1; r->group = 1; @@ -1346,11 +1353,10 @@ RRDR *rrd2rrdr(RRDSET *st, long points, long long after, long long before, int g calculated_number *cn = rrdr_line_values(r); uint8_t *co = rrdr_line_options(r); - for(rd = st->dimensions, c = 0 ; likely(rd && c < dimensions) ; rd = rd->next, c++) { + for(rd = st->dimensions, c = 0 ; rd && c < dimensions ; rd = rd->next, c++) { // update the dimension options if(likely(found_non_zero[c])) r->od[c] |= RRDR_NONZERO; - if(unlikely(rd->flags & RRDDIM_FLAG_HIDDEN)) r->od[c] |= RRDR_HIDDEN; // store the specific point options co[c] = group_options[c]; |