URL: https://github.com/freeipa/freeipa/pull/422
Author: frasertweedale
 Title: #422: Fix reference before assignment
Action: opened

PR body:
"""
In 'store_session_cookie', if the server does not set the session
cookie for some reason, the 'session_cookie' variable does not get
assigned, resulting in UnboundLocalError.  Set an initial value of
'None'.

Fixes: https://fedorahosted.org/freeipa/ticket/6636
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/422/head:pr422
git checkout pr422
From 530721a57f560e9d14264303a2a60e8d37646ff7 Mon Sep 17 00:00:00 2001
From: Fraser Tweedale <ftwee...@redhat.com>
Date: Tue, 31 Jan 2017 11:23:58 +1000
Subject: [PATCH] Fix reference before assignment

In 'store_session_cookie', if the server does not set the session
cookie for some reason, the 'session_cookie' variable does not get
assigned, resulting in UnboundLocalError.  Set an initial value of
'None'.

Fixes: https://fedorahosted.org/freeipa/ticket/6636
---
 ipalib/rpc.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ipalib/rpc.py b/ipalib/rpc.py
index fb739f8..356ec42 100644
--- a/ipalib/rpc.py
+++ b/ipalib/rpc.py
@@ -706,6 +706,7 @@ def store_session_cookie(self, cookie_header):
             cookie_header = [cookie_header]
 
         # Search for the session cookie
+        session_cookie = None
         try:
             for cookie in cookie_header:
                 session_cookie = \
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to