Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1131

Improve URL parsing for usernames containing an at "@" sign

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • proton-c-future
    • proton-c
    • None

    Description

      In the case the username being passed via the URL contains an at sign ("@") (e.g. during SASL PLAIN authentication), the URL parsing will fail because it will take the first at sign as the mark of the host name start.

      Example URL:

      amqps://myFirstDevice@sas.tcontehub:password@tcontehub.azure-devices.net/devices/myFirstDevice/messages/events

      In this case the user name is "myFirstDevice@sas.tcontehub".

      Suggested fix: use strrchr() instead of strchr() in order to match the last occurence of an at sign, marking the start of the host name.

      $ diff ./util.c ~/qpid-proton/proton-c/src/util.c
      167c167
      < char *at = strchr(url, '@');

      > char *at = strrchr(url, '@');

      Attachments

        Activity

          People

            Unassigned Unassigned
            tomconte Thomas Conté
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: