Skip to content

Commit

Permalink
fix(ldap): crash if no results are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jan 30, 2019
1 parent 1738287 commit 8ff63ba
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
10 changes: 9 additions & 1 deletion .snyk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.8.0
version: v1.13.3
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
'npm:ms:20170412':
Expand Down Expand Up @@ -40,6 +40,14 @@ ignore:
- pm2 > shelljs:
reason: None given
expires: '2017-06-16T22:52:26.705Z'
'npm:mailparser:20180625':
- mailparser:
reason: None given
expires: '2019-03-01T20:00:32.980Z'
'npm:mem:20180117':
- libnpx > yargs > os-locale > mem:
reason: None given
expires: '2019-03-01T20:00:32.980Z'
# patches apply the minimum changes required to fix a vulnerability
patch:
'npm:marked:20170112':
Expand Down
1 change: 1 addition & 0 deletions src/controllers/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ accountsController.bindLdap = function (req, res) {

ldap.search(searchBase, filter, function (err, results) {
if (err && !res.headersSent) return res.status(400).json({ success: false, error: err })
if (_.isUndefined(results)) return res.status(400).json({ success: false, error: 'Undefined Results' })

var entries = results.entries
var foundUsers = null
Expand Down
26 changes: 13 additions & 13 deletions src/public/js/angularjs/controllers/tickets.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
. .o8 oooo
.o8 "888 `888
.o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
888 888 888 888 888 888 888ooo888 `"Y88b. 888888.
888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.
"888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
========================================================================
Created: 02/10/2015
Author: Chris Brame
**/
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 888 888 888ooo888 `"Y88b. 888888.
* 888 . 888 888 888 888 888 888 .o o. )88b 888 `88b.
* "888" d888b `V88V"V8P' `Y8bod88P" `Y8bod8P' 8""888P' o888o o888o
* ========================================================================
* Author: Chris Brame
* Updated: 1/30/19 3:05 AM
* Copyright (c) 2014-2019. All rights reserved.
*/

define([
'angular',
Expand Down
1 change: 1 addition & 0 deletions src/settings/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ function ticketTypeSettingDefault (callback) {

var type = _.first(types)
if (!type) return callback('No Types Defined!')
if (!_.isPlainObject(type) || !_.has(type, '_id')) return callback('Invalid Type. Skipping.')

// Save default ticket type
var defaultTicketType = new SettingsSchema({
Expand Down

0 comments on commit 8ff63ba

Please sign in to comment.