Uploaded image for project: 'Shibboleth SP - C++'
  1. Shibboleth SP - C++
  2. SSPCPP-726

Misleading indentation in RelayState JSON output code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.6.1
    • Component/s: None
    • Labels:
      None
    • Operating System:
      Multiple
    • CPU Type:
      Multiple
    • C/C++ Compiler:
      Multiple
    • Web Server:
      Multiple

      Description

      The JSON output isn't really conditional in the current code, contrary to what the formatting suggests. If it should be conditional, I propose the following patch:

      diff --git a/shibsp/handler/impl/ExternalAuthHandler.cpp b/shibsp/handler/impl/ExternalAuthHandler.cpp
      index c17ca1f..e459a11 100644
      --- a/shibsp/handler/impl/ExternalAuthHandler.cpp
      +++ b/shibsp/handler/impl/ExternalAuthHandler.cpp
      @@ -592,8 +592,10 @@ pair<bool,long> ExternalAuth::processMessage(
                   }
               }
               os << " ]";
      -        if (!target.empty())
      -            os << ", \"RelayState\": "; json_safe(os, target.c_str());
      +        if (!target.empty()) {
      +            os << ", \"RelayState\": ";
      +            json_safe(os, target.c_str());
      +        }
               os << " }";
           }
           else {
      
      

        Attachments

          Activity

            People

            Assignee:
            rdw@iay.org.uk Rod Widdowson
            Reporter:
            wferi@niif.hu Wágner Ferenc
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m