diff --git a/ChangeLog.md b/ChangeLog.md index 1062e35a..8ef5496f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,7 @@ * Fix new Java 21 compiler warning: `possible 'this' escape before subclass is fully initialized`. * Tweak OSGi bundle manifest to allow Log4j 3. * [#362](https://github.com/mwiede/jsch/issues/362) fix PEM key parsing to work with windows line endings. + * [#361](https://github.com/mwiede/jsch/issues/361) guard against `UIKeyboardInteractive` implementations that include NULL elements in the `String[]` returned from `promptKeyboardInteractive()`. * [0.2.9](https://github.com/mwiede/jsch/releases/tag/jsch-0.2.9) * [#293](https://github.com/mwiede/jsch/issues/293) allow UserAuthNone to be extended. * Make JGSS module optional. diff --git a/src/main/java/com/jcraft/jsch/UserAuthKeyboardInteractive.java b/src/main/java/com/jcraft/jsch/UserAuthKeyboardInteractive.java index c7aff920..cd5d5eda 100644 --- a/src/main/java/com/jcraft/jsch/UserAuthKeyboardInteractive.java +++ b/src/main/java/com/jcraft/jsch/UserAuthKeyboardInteractive.java @@ -141,7 +141,7 @@ public boolean start(Session session) throws Exception { if (_response != null) { response = new byte[_response.length][]; for (int i = 0; i < _response.length; i++) { - response[i] = Util.str2byte(_response[i]); + response[i] = _response[i] != null ? Util.str2byte(_response[i]) : Util.empty; } } }