Context |
Check |
Description |
tedd_an/pre-ci_am |
success
|
Success
|
tedd_an/CheckPatch |
warning
|
WARNING:LINE_SPACING: Missing a blank line after declarations
#80: FILE: android/handsfree.c:1254:
+ int printed;
+ printed = sprintf(ptr, "(\"%s\",(%d%c%d)),",
/github/workspace/src/src/13665905.patch total: 0 errors, 1 warnings, 32 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13665905.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
|
tedd_an/GitLint |
fail
|
WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
4: B1 Line exceeds max length (322>80): "bluez-5.75/android/handsfree.c:1247:15: error[cpp/NegativeIndex]: The value from sprintf, a standard library function that can return a negative value is used as an index. A negative array index can lead to reading or writing outside the bounds of the array. Ensure the value of the index used is within bounds before use."
5: B3 Line contains hard tab characters (\t): "1245| buf = g_malloc(len);"
7: B3 Line contains hard tab characters (\t): "1247|-> ptr = buf + sprintf(buf, "+CIND:");"
9: B3 Line contains hard tab characters (\t): "1249| for (i = 0; i < IND_COUNT; i++) {"
|
@@ -1243,15 +1243,22 @@ static void at_cmd_cind(struct hfp_context *result, enum hfp_gw_cmd_type type,
}
buf = g_malloc(len);
-
- ptr = buf + sprintf(buf, "+CIND:");
+ if (sprintf(buf, "+CIND:") != strlen("+CIND:")) {
+ g_free(buf);
+ break;
+ }
+ ptr = buf + strlen("+CIND:");
for (i = 0; i < IND_COUNT; i++) {
- ptr += sprintf(ptr, "(\"%s\",(%d%c%d)),",
+ int printed;
+ printed = sprintf(ptr, "(\"%s\",(%d%c%d)),",
dev->inds[i].name,
dev->inds[i].min,
dev->inds[i].max == 1 ? ',' : '-',
dev->inds[i].max);
+ if (printed < 0)
+ goto fail;
+ ptr += printed;
}
ptr--;
@@ -1273,6 +1280,7 @@ static void at_cmd_cind(struct hfp_context *result, enum hfp_gw_cmd_type type,
break;
}
+fail:
hfp_gw_send_result(dev->gw, HFP_RESULT_ERROR);
if (dev->state != HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED)