You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Modular Input - textInNode throwing exception when input string is empty #122
Version of this project you're using 1.6.4
Platform version osx 10.13.3 (high sierra)
Framework version java 1.8.0_131
Splunk version 7.0.2 - 03bbabbd5c0f
Other relevant information (ex: local/remote environment, Splunk network configuration)
I tracked down this bug because at surface level, it appeared that input validation was not being executed. Indeed it wasn't being executed because XmlUtil.textInNode would throw an exception when encountering an argument with a null/empty value.
I have a proposed fix below that seems to work on 7.0.2, but i can't speak to backwards compatibility with older versions of splunk
Hi @segfault-,
We have checked the usage of XmlUtil.textInNode method in entire SDK code, and has found that null checks are implemented where this method is called.
We have also executed Validation test, but could not encounter this issue.
We would recommend to update SDK version to 1.7.1 and make use of JDK 1.8 & maven build, as we have migrated from Ant to Maven.
Please let us know, if you still face any issue, along with details to reproduce.
Here no null check is performed for the child variable. In case when the modular input parameter has no value, child will be null and child.getNodeType() leads to null pointer.
Please let me know if you need any other information regarding this issue.
Activity
segfault- commentedon Mar 23, 2018
my formatting didn't go thru, i just added a child!=null check
shakeelmohamed commentedon Mar 23, 2018
Hi @segfault-, thanks for you note. Feel free to open a pull request if there's a specific change you'd like to see
bparmar-splunk commentedon Aug 27, 2021
Hi @segfault-,
We have checked the usage of XmlUtil.textInNode method in entire SDK code, and has found that null checks are implemented where this method is called.
We have also executed Validation test, but could not encounter this issue.
We would recommend to update SDK version to 1.7.1 and make use of JDK 1.8 & maven build, as we have migrated from Ant to Maven.
Please let us know, if you still face any issue, along with details to reproduce.
jrobins04 commentedon Oct 25, 2022
Hi @bparmar-splunk,
I am able to reproduce this using v1.9.1. This issue happens when the user provides no value for a modular input parameter.
https://github.com/splunk/splunk-sdk-java/blob/master/splunk/src/main/java/com/splunk/modularinput/XmlUtil.java textInNode() line number 38:
Here no null check is performed for the
childvariable. In case when the modular input parameter has no value,childwill be null andchild.getNodeType()leads to null pointer.Please let me know if you need any other information regarding this issue.