Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-17647 Clean up code via static code review sweep for 2.7
  3. SAK-17650

Potential NPE in DavServlet - found by Static Code Review

    Details

    • Type: Sub-task
    • Status: OPEN
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.7.0, 10.5
    • Fix Version/s: None
    • Component/s: WebDAV
    • Labels:
      None
    • Environment:
      Static code review

      Description

      if lock.owner is null then status is set to bad request, but then throws an NPE at line 3057 DavServlet

      if (lock.owner == null)

      { // Bad request resp.setStatus(SakaidavStatus.SC_BAD_REQUEST); }

      // contribute feeds us an owner that looks
      // like <A:href>...</A:href>. Since we'll put it
      // back with a different namespace prefix, we
      // don't want to save it that way.

      lock.owner = lock.owner.replaceAll("<(/?)[^>]+[hH][rR][eE][fF])>", "<$1$2>");
      // System.out.println("lock.owner: " + lock.owner);

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                hedrick Charles Hedrick
                Reporter:
                a.m.berg@uva.nl Alan Berg
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    Git Integration