summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | transports: smart_pkt: fix memory leaks on error pathsPatrick Steinhardt2016-02-231-10/+11
| | | | |
| * | | | refdb_fs: remove unnecessary check for NULLPatrick Steinhardt2016-02-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fail-label of `reflog_parse` explicitly checks the entry poitner for NULL before freeing it. When we jump to the label the variable has to be set to a non-NULL and valid pointer though: if the allocation fails we immediately return with an error code and if the loop was not entered we return with a success code, withouth executing the label's code. Remove the useless NULL-check to silence Coverity.
| * | | | diff_print: assert patch is non-NULLPatrick Steinhardt2016-02-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When invoking `diff_print_info_init_frompatch` it is obvious that the patch should be non-NULL. We explicitly check if the variable is set and continue afterwards, happily dereferencing the potential NULL-pointer. Fix this by instead asserting that patch is set. This also silences Coverity.
| * | | | pack-objects: return early when computing write order failsPatrick Steinhardt2016-02-231-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function `compute_write_order` may return a `NULL`-pointer when an error occurs. In such cases we jump to the `done`-label where we try to clean up allocated memory. Unfortunately we try to deallocate the `write_order` array, though, which may be NULL here. Fix this error by returning early instead of jumping to the `done` label. There is no data to be cleaned up anyway.
| * | | | pack-objects: check realloc in try_delta with GITERR_CHECK_ALLOCPatrick Steinhardt2016-02-231-2/+4
| | | | |
| * | | | crlf: do not ignore GIT_PASSTHROUGH errorPatrick Steinhardt2016-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no payload is set for `crlf_apply` we try to compute the crlf attributes ourselves with `crlf_check`. When the function determines that the current file does not require any treatment we return the GIT_PASSTHROUGH error code without actually allocating the out-pointer, which indicates the file should not be passed through the filter. The `crlf_apply` function explicitly checks for the GIT_PASSTHROUGH return code and ignores it. This means we will try to apply the crlf-filter to the current file, leading us to dereference the unallocated payload-pointer. Fix this obviously incorrect behavior by not treating GIT_PASSTHROUGH in any special way. This is the correct thing to do anyway, as the code indicates that the file should not be passed through the filter.
| * | | | refspec: check buffer with GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-231-4/+4
| | | | |
| * | | | revwalk: use GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-231-2/+1
| | | | |
| * | | | smart_pkt: check buffer with GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-231-1/+3
| | | | |
| * | | | path: use GITERR_CHECK_ALLOC_BUF to verify passed in bufferPatrick Steinhardt2016-02-231-2/+1
| | | | |
| * | | | common: introduce GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We commonly have to check if a git_buf has been allocated correctly or if we ran out of memory. Introduce a new macro similar to `GITERR_CHECK_ALLOC` which checks if we ran OOM and if so returns an error. Provide a `#nodef` for Coverity to mark the error case as an abort path.
* | | | | Merge pull request #3630 from libgit2/cmn/idx-extra-checkEdward Thomson2016-02-251-1/+18
|\ \ \ \ \ | |_|/ / / |/| | | | Extra checks for packfile indices
| * | | | pack: don't allow a negative offsetcmn/idx-extra-checkCarlos Martín Nieto2016-02-251-0/+5
| | | | |
| * | | | pack: make sure we don't go out of bounds for extended entriesCarlos Martín Nieto2016-02-251-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A corrupt index might have data that tells us to go look past the end of the file for data. Catch these cases and return an appropriate error message.
* | | | | openssl: we already had the function, just needed the headercmn/thisisterribleCarlos Martín Nieto2016-02-241-6/+1
| | | | |
* | | | | openssl: export the locking function when building without OpenSSLCarlos Martín Nieto2016-02-241-0/+6
|/ / / / | | | | | | | | | | | | | | | | This got lost duing the move and it lets the users call this function just in case.
* | | | map: use `giterr_set` internallyEdward Thomson2016-02-231-1/+1
|/ / / | | | | | | | | | | | | | | | Use the `giterr_set` function, which actually supports `GITERR_OS`. The `giterr_set_str` function is exposed for external users and will not append the operating system's error message.
* | | git_libgit2_opts: validate keyEdward Thomson2016-02-221-0/+3
| | |
* | | openssl: re-export the last-resort locking functionv0.24.0-rc1cmn/init-sshCarlos Martín Nieto2016-02-191-0/+1
| | | | | | | | | | | | | | | We need to include the header where we define the function. Otherwise it won't be available on the DLL.
* | | openssl: free the context even if we don't connectCarlos Martín Nieto2016-02-191-1/+1
| | |
* | | global: remove an unused variableCarlos Martín Nieto2016-02-191-8/+0
| | |
* | | Merge pull request #3597 from ethomson/filter_registrationCarlos Martín Nieto2016-02-196-279/+336
|\ \ \ | | | | | | | | Filter registration
| * | | filter: avoid races during filter registrationEdward Thomson2016-02-082-124/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would set the global filter registry structure before adding filters to the structure, without a lock, which is quite racy. Now, register default filters during global registration and use an rwlock to read and write the filter registry (as appopriate).
| * | | mingw: use gcc-like memory barrierEdward Thomson2016-02-081-1/+1
| | | | | | | | | | | | | | | | Use the gcc-like memory barrier (__sync_synchronize) on mingw.
| * | | global: make openssl registration like the restEdward Thomson2016-02-083-115/+128
| | | |
| * | | global: refactor setup and cleanupEdward Thomson2016-02-081-59/+70
| | | | | | | | | | | | | | | | | | | | Move the common initialization and cleanup methods to reduce unnecessary duplication.
* | | | netops: fix memory leak when an error occursPatrick Steinhardt2016-02-181-0/+4
| | | |
* | | | transports: smart_pkt: fix memory leaksPatrick Steinhardt2016-02-181-0/+3
| | | |
* | | | transports: smart: fix memory leak on OOM pathPatrick Steinhardt2016-02-181-0/+2
| | | |
* | | | signature: use GITERR_CHECK_ALLOC to check for OOM situationPatrick Steinhardt2016-02-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking for out of memory situations we usually use the GITERR_CHECK_ALLOC macro. Besides conforming to our current code base it adds the benefit of silencing errors in Coverity due to Coverity handling the macro's error path as abort.
* | | | Merge pull request #3604 from ethomson/nsec_xplatCarlos Martín Nieto2016-02-183-7/+7
|\ \ \ \ | | | | | | | | | | Handle `USE_NSECS`
| * | | | xplat: use st_mtimespec everywhere on macEdward Thomson2016-02-092-6/+6
| | | | |
| * | | | Fix the build when defining USE_NSECMarius Ungureanu2016-01-251-1/+1
| | | | |
* | | | | Merge pull request #3606 from ethomson/drop_xpCarlos Martín Nieto2016-02-181-18/+3
|\ \ \ \ \ | | | | | | | | | | | | win32: drop xp support in WideCharToMultiByte
| * | | | | win32: drop xp support in WideCharToMultiByteEdward Thomson2016-02-091-18/+3
| | | | | |
* | | | | | Merge pull request #3613 from ethomson/fixupsCarlos Martín Nieto2016-02-189-37/+103
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove most of the silly warnings
| * | | | | | winhttp: use an unsigned iteratorEdward Thomson2016-02-161-1/+1
| | | | | | |
| * | | | | | submodule: explicitly cast to the teensy time valueEdward Thomson2016-02-161-2/+2
| | | | | | |
| * | | | | | index: explicitly cast the teeny index entry membersEdward Thomson2016-02-161-3/+3
| | | | | | |
| * | | | | | index: don't use `seek` return as an error codeEdward Thomson2016-02-161-2/+2
| | | | | | |
| * | | | | | index: explicitly cast new hash size to an intEdward Thomson2016-02-161-1/+1
| | | | | | |
| * | | | | | fstat: use our custom `stat`Edward Thomson2016-02-163-12/+62
| | | | | | |
| * | | | | | tree: zap warnings around `size_t` vs `uint16_t`Edward Thomson2016-02-161-10/+16
| | | | | | |
| * | | | | | win32: introduce p_timeval that isn't stupidEdward Thomson2016-02-125-6/+16
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | Windows defines `timeval` with `long`, which we cannot sanely cope with. Instead, use a custom timeval struct.
* | | | | | Merge pull request #3619 from ethomson/win32_forbiddenCarlos Martín Nieto2016-02-186-20/+55
|\ \ \ \ \ \ | | | | | | | | | | | | | | win32: allow us to read indexes with forbidden paths on win32
| * | | | | | index: allow read of index w/ illegal entriesEdward Thomson2016-02-175-17/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow `git_index_read` to handle reading existing indexes with illegal entries. Allow the low-level `git_index_add` to add properly formed `git_index_entry`s even if they contain paths that would be illegal for the current filesystem (eg, `AUX`). Continue to disallow `git_index_add_bypath` from adding entries that are illegal universally illegal (eg, `.git`, `foo/../bar`).
| * | | | | | iterator: assert tree_iterator has a frameEdward Thomson2016-02-171-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although a `tree_iterator` that failed to be properly created does not have a frame, all other `tree_iterator`s should. Do not call `pop` in the failure case, but assert that in all other cases there is a frame.
| * | | | | | Validate pointer before access the member.Colin Xu2016-02-171-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Git repository at network locations, sometimes git_iterator_for_tree fails at iterator__update_ignore_case so it goes to git_iterator_free. Null pointer will crash the process if not check. Signed-off-by: Colin Xu <colin.xu@gmail.com>
* | | | | | | commit: expose the different kinds of errorsCarlos Martín Nieto2016-02-161-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should be checking whether the object we're looking up is a commit, and we should let the caller know whether the not-found return code comes from a bad object type or just a missing signature.
* | | | | | | rebase: persist a single in-memory indexEdward Thomson2016-02-151-12/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When performing an in-memory rebase, keep a single index for the duration, so that callers have the expected index lifecycle and do not hold on to an index that is free'd out from under them.