vamsi2246 opened a new pull request, #5944: URL: https://github.com/apache/couchdb/pull/5944
## Overview This PR fixes a critical bug where the JavaScript view server crashes if a user-defined map or reduce function throws `null` or `undefined`. ## Details When a `map` function executes `throw null;`, the resulting error caught by `views.js` is `null`. The `handleViewError` function attempts to check `if (err[0] == "fatal")`, which immediately throws a `TypeError: Cannot read properties of null (reading '0')`. Because this occurs inside the uncaught error handler, it crashes the entire `couchjs` OS process, failing the view query completely. The same vulnerability exists inside `errstr` (`util.js`) which unsafely checks `e.toSource`. This patch adds safe null checks to these critical property accesses, allowing the view server to correctly log the `null` exception and proceed without crashing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
