Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1761

Missing null check in parse method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 4.4.1, 4.5, 4.5.1, 4.5.2
    • 4.5.3
    • None
    • None
    • Patch

    Description

      While in org.apache.http.client.utils.URLEncodedUtils the method

      public static List<NameValuePair> parse(String s, Charset charset, char... separators)
      

      has a null check for String "s", this method has no null check:

      public static List<NameValuePair> parse(String s, Charset charset)
      

      For consistency and backward compatibility reasons I recommend adding a null check there.

      Furthermore I would delegate to the method with separators:

      public static List<NameValuePair> parse(String s, Charset charset) {
              return URLEncodedUtils.parse(s, charset, '&', ';');
      } 
      

      Attachments

        1. HTTPCLIENT-1761.patch
          0.8 kB
          Thomas Feiner

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tfeiner Thomas Feiner
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: