#vulnerable code 
                             private final void newMisplacedTokenException(int cursor) {
		if (_buflen < 0)
			throw new IllegalStateException(
					"Incomplete data or malformed json : encoutered end of stream.");

		if (cursor < 0) cursor = 0;
		int pos = (_position - valueAsString().length() - _buflen + cursor);
		if (pos < 0) pos = 0;

		throw new IllegalStateException("Encountred misplaced character '" + _buffer[cursor]
				+ "' around position " + pos);
	} 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             private final void newMisplacedTokenException(int cursor) {
		if (_buflen < 0)
			throw new IllegalStateException(
					"Incomplete data or malformed json : encoutered end of stream.");

		if (cursor < 0) cursor = 0;
		int pos = _position - (_buflen - cursor);
		if (pos < 0) pos = 0;

		throw new IllegalStateException("Encountred misplaced character '" + _buffer[cursor]
				+ "' around position " + pos);
	}