git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Code AI <techsupport@mycode.ai>
To: git@vger.kernel.org
Subject: [PATCH] CodeAI fixes 1 Allocator sizeof() operand mismatch, 2 Null Pointer Dereference, and 2 Dead Code
Date: Wed, 14 Feb 2018 10:50:12 -0500	[thread overview]
Message-ID: <CAGm8dMApDdLEzeKU-h16G0NSpnuk9LMTWA29t4MxO1qcNpUvhA@mail.gmail.com> (raw)

Hi my name is Benjamin Bales.

I am the founder and creator of CodeAI,
the first non-human contributor to your software project. CodeAI finds
and fixes security defects for you. It fixed 18. It wants to merge 5
commits - 1 Allocator sizeof() operand mismatch, 2 Null Pointer
Dereference issues and 2 Dead Code issues in git. To view all 18 fixed
issues from the run claim your free open source account at mycode.ai
and the Dockerfile used to build and run your project in CodeAI, here-
https://drive.google.com/open?id=12d2poeHabdc0DSShDcekSU5bI0Il6Qv- .
It is always free for open source projects.

If you have any questions about these results or have general
inquiries about CodeAI, please send an email to techsupport@mycode.ai

Allocator sizeof() mismatch:
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index 1145d51..c3ea5c1 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -86,7 +86,7 @@ static void perf_hashmap(unsigned int method,
unsigned int rounds)
        unsigned int i, j;

        entries = malloc(TEST_SIZE * sizeof(struct test_entry *));
-       hashes = malloc(TEST_SIZE * sizeof(int));
+       hashes = malloc(TEST_SIZE * sizeof(unsigned));
        for (i = 0; i < TEST_SIZE; i++) {
                snprintf(buf, sizeof(buf), "%i", i);
                entries[i] = alloc_test_entry(0, buf, strlen(buf), "", 0);


Null dereference fixes:
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 4c51aec..f26858a 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1604,7 +1604,7 @@ static void show_pack_info(int stat_only)
                             "non delta: %d objects",
                             baseobjects),
                          baseobjects);
-       for (i = 0; i < deepest_delta; i++) {
+       for (i = 0; chain_histogram && (i < deepest_delta); i++) {
                if (!chain_histogram[i])
                        continue;
                printf_ln(Q_("chain length = %d: %lu object",

diff --git a/unpack-trees.c b/unpack-trees.c
index 96c3327..fcd9332 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1721,7 +1721,7 @@ static int verify_absent(const struct cache_entry *ce,
                         enum unpack_trees_error_types error_type,
                         struct unpack_trees_options *o)
 {
-       if (!o->skip_sparse_checkout && (ce->ce_flags & CE_NEW_SKIP_WORKTREE))
+       if (ce && (!o->skip_sparse_checkout && (ce->ce_flags &
CE_NEW_SKIP_WORKTREE)))
                return 0;
        return verify_absent_1(ce, error_type, o);
 }


Dead code fixes:
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -235,7 +235,6 @@ static int edit_patch(int argc, const char **argv,
const char *prefix)
        init_revisions(&rev, prefix);
        rev.diffopt.context = 7;

-       argc = setup_revisions(argc, argv, &rev, NULL);
        rev.diffopt.output_format = DIFF_FORMAT_PATCH;
        rev.diffopt.use_color = 0;
        rev.diffopt.flags.ignore_dirty_submodules = 1;

diff --git a/fsck.c b/fsck.c
index 032699e..78563c3 100644
--- a/fsck.c
+++ b/fsck.c
@@ -704,7 +704,6 @@ static int fsck_ident(const char **ident, struct
object *obj, struct fsck_option
            !isdigit(p[4]) ||
            (p[5] != '\n'))
                return report(options, obj, FSCK_MSG_BAD_TIMEZONE,
"invalid author/committer line - bad time zone");
-       p += 6;
        return 0;
 }

-- 
Sincerely,

CodeAI Tech Support Team

             reply	other threads:[~2018-02-14 15:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 15:50 Code AI [this message]
2018-02-14 16:46 ` [PATCH] CodeAI fixes 1 Allocator sizeof() operand mismatch, 2 Null Pointer Dereference, and 2 Dead Code Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGm8dMApDdLEzeKU-h16G0NSpnuk9LMTWA29t4MxO1qcNpUvhA@mail.gmail.com \
    --to=techsupport@mycode.ai \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).