summaryrefslogtreecommitdiffstats
path: root/runtime/objomsr.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-04-13 12:17:08 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-04-13 12:17:08 +0200
commit85759e244dc81fa153098e0c5070c1f7aa815a0d (patch)
tree319d06fec444c9880bef5eac839f4db3eccea796 /runtime/objomsr.c
parentbbefbee0d02e49326ff5757061cde2f26ad088d4 (diff)
downloadrsyslog-85759e244dc81fa153098e0c5070c1f7aa815a0d.tar.gz
rsyslog-85759e244dc81fa153098e0c5070c1f7aa815a0d.tar.xz
rsyslog-85759e244dc81fa153098e0c5070c1f7aa815a0d.zip
bugfix: report error if module tries to request more strings than supported
Diffstat (limited to 'runtime/objomsr.c')
-rw-r--r--runtime/objomsr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/objomsr.c b/runtime/objomsr.c
index a1dad1c8..7241fa27 100644
--- a/runtime/objomsr.c
+++ b/runtime/objomsr.c
@@ -60,11 +60,14 @@ rsRetVal OMSRdestruct(omodStringRequest_t *pThis)
*/
rsRetVal OMSRconstruct(omodStringRequest_t **ppThis, int iNumEntries)
{
- omodStringRequest_t *pThis;
+ omodStringRequest_t *pThis = NULL;
DEFiRet;
assert(ppThis != NULL);
assert(iNumEntries >= 0);
+ if(iNumEntries > CONF_OMOD_NUMSTRINGS_MAXSIZE) {
+ ABORT_FINALIZE(RS_RET_MAX_OMSR_REACHED);
+ }
CHKmalloc(pThis = calloc(1, sizeof(omodStringRequest_t)));
/* got the structure, so fill it */