avoid NULL-deref (gridfs_store_stream_init API change)

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      latest from git, Fedora 14, x86_64
    • None
    • Minor Change
    • None
    • None
    • None
    • None
    • None
    • None

      There are two unchecked malloc calls in the void-typed gridfs_store_stream_init function.
      To handle the possibility of NULL return, the function must return non-void. I chose "int"
      in the attached patch.

      Also, it's cleaner to use "strdup" rather than the combination of malloc and strcpy.

            Assignee:
            Kyle Banker (Inactive)
            Reporter:
            Jim Meyering
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: