summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | index: fix contradicting comparisonPatrick Steinhardt2016-02-232-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The overflow check in `read_reuc` tries to verify if the `git__strtol32` parses an integer bigger than UINT_MAX. The `tmp` variable is casted to an unsigned int for this and then checked for being greater than UINT_MAX, which obviously can never be true. Fix this by instead fixing the `mode` field's size in `struct git_index_reuc_entry` to `uint32_t`. We can now parse the int with `git__strtol64`, which can never return a value bigger than `UINT32_MAX`, and additionally checking if the returned value is smaller than zero. We do not need to handle overflows explicitly here, as `git__strtol64` returns an error when the returned value would overflow.
| * | | index: plug memory leak in `read_conflict_names`Patrick Steinhardt2016-02-231-4/+14
| | | |
| * | | 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-232-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | coverity: hint git_vector_foreach does not deref NULL contentsPatrick Steinhardt2016-02-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity does not comprehend the connection between a vector's size and the contents pointer, that is that the vector's pointer is non-NULL when its size is positive. As the vector code should be reasonably well tested and users are expected to not manually modify a vector's contents it seems save to assume that the macros will never dereference a NULL pointer. Fix Coverity warnings by overriding the foreach macros with macros that explicitly aborting when (v)->contents is NULL.
* | | | 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.
* | | | Merge pull request #3637 from libgit2/cmn/conventionsEdward Thomson2016-02-252-0/+38
|\ \ \ \ | | | | | | | | | | CONVENTIONS: update to include general public API principles
| * | | | CONVENTIONS: update to include general public API principlescmn/conventionsCarlos Martín Nieto2016-02-252-0/+38
|/ / / /
* | | | 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.
* | | Merge pull request #3631 from ethomson/giterr_fixupsCarlos Martín Nieto2016-02-232-6/+1
|\ \ \ | |/ / |/| | Minor `giterr` fixups
| * | giterr_set_str: remove `GITERR_OS` documentationEdward Thomson2016-02-231-5/+0
| | | | | | | | | | | | | | | The `giterr_set_str` does not actually honor `GITERR_OS`. Remove the documentation that claims that we do.
| * | 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.
* | Merge pull request #3629 from ethomson/set_user_agent_docVicent Marti2016-02-233-0/+15
|\ \ | | | | | | git_libgit2_opts: minor documentation & usage fixes
| * | git_libgit2_opts: validate keyEdward Thomson2016-02-222-0/+9
| | |
| * | git_libgit2_opts: document GIT_OPT_SET_USER_AGENTEdward Thomson2016-02-221-0/+6
|/ /
* | Merge pull request #3627 from libgit2/cmn/typoEdward Thomson2016-02-222-3/+3
|\ \ | | | | | | Fix a few checkout -> rebase typos
| * | Fix a few checkout -> rebase typoscmn/typoCarlos Martín Nieto2016-02-222-3/+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.
* | CHANGELOG: add a few missing changesCarlos Martín Nieto2016-02-191-1/+22
| |
* | 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-197-304/+370
|\ \ | | | | | | Filter registration
| * | filter: clean up documentation around custom filtersEdward Thomson2016-02-091-25/+34
| | |
| * | 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.
* | | Merge pull request #3614 from pks-t/pks/coverity-fixesCarlos Martín Nieto2016-02-195-3/+30
|\ \ \ | | | | | | | | Coverity fixes
| * | | 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.
| * | | coverity: hint that string length is at least 2Patrick Steinhardt2016-02-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking if a string is prefixed by a drive letter (e.g. "C:") we verify this by inspecting the first and second character of the string. Coverity thinks this is a defect as we do not check the string's length first, but in fact we only check the second character if the first character is part of the alphabet, that is it cannot be '\0'. Fix this by overriding the macro and explicitly checking the string's length.
| * | | coverity: add nodefs for abort macrosPatrick Steinhardt2016-02-181-0/+17
|/ / / | | | | | | | | | | | | | | | | | | Add nodefs for macros that abort the current flow due to errors. This includes macros that trigger on integer overflows and for the version check macro. This aids Coverity as we point out that these paths will cause a fatal error.
* | | 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