-
Notifications
You must be signed in to change notification settings - Fork 0
fix(adhoc-sweep-fixes): 35 review findings across 25 files #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
9a43456
be80d30
849a16b
60fe92d
7c32d05
1edcf03
e77e300
01dd311
ed4bac6
589bd0e
7fa6904
dbb9fbb
91e5d7c
ba0fd83
9519cb0
3840ccb
cd9b903
0fd44a3
194a329
3afcb9f
c5e07b5
ad80f6c
3c80c69
a749e47
23fd847
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,14 +113,15 @@ jobs: | |
| - name: Upload combined artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: openssl-3.5.4-macos-all | ||
| name: openssl-${{ github.event.inputs.openssl_version || '3.5.4' }}-macos-all | ||
| path: openssl-macos-libs/ | ||
| retention-days: 90 | ||
|
|
||
| - name: Create build report | ||
| run: | | ||
| cat > BUILD_REPORT.md << 'EOF' | ||
| # OpenSSL 3.5.4 macOS Build Report | ||
| OPENSSL_VERSION="${{ github.event.inputs.openssl_version || '3.5.4' }}" | ||
| cat > BUILD_REPORT.md << EOF | ||
| # OpenSSL $OPENSSL_VERSION macOS Build Report | ||
|
|
||
| ## Build Date | ||
| $(date -u +"%Y-%m-%d %H:%M:%S UTC") | ||
|
Comment on lines
113
to
127
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🔵 BUILD_REPORT.md generation uses a single-quoted heredoc so $(date ...) and other command substitutions are never expanded In the "Create build report" step, changed the heredoc delimiter from single-quoted 🤖 Prompt for AI agentsfix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer
Comment on lines
113
to
127
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🔵 GitHub Actions matrix downloads openssl_version input string but combine-artifacts job's build report hardcodes version 3.5.4 independent of the workflow_dispatch input Introduced 🤖 Prompt for AI agentsfix confidence: 🟡 70 medium — react 👍/👎 to teach the reviewer |
||
|
|
@@ -139,20 +140,20 @@ jobs: | |
|
|
||
| ## Build Configuration | ||
| All builds use identical OpenSSL configure options: | ||
| ``` | ||
| \`\`\` | ||
| no-weak-ssl-ciphers no-srp no-psk no-comp no-zlib no-zlib-dynamic | ||
| no-threads no-dso no-shared no-asm no-rc5 no-idea | ||
| no-md4 no-rmd160 no-ssl no-ssl3 no-seed no-camellia no-bf no-cast | ||
| no-md2 no-mdc2 | ||
| ``` | ||
| \`\`\` | ||
|
|
||
| ## Compiler | ||
| - Xcode Command Line Tools (Clang) | ||
| - x86_64: darwin64-x86_64-cc target with -mmacosx-version-min=10.13 | ||
| - ARM64: darwin64-arm64-cc target with -mmacosx-version-min=11.0 | ||
|
|
||
| ## GitHub Actions Workflow | ||
| Built using: `.github/workflows/build-openssl-macos.yml` | ||
| Built using: \`.github/workflows/build-openssl-macos.yml\` | ||
|
|
||
| EOF | ||
|
|
||
|
|
@@ -162,3 +163,4 @@ jobs: | |
| name: build-report | ||
| path: BUILD_REPORT.md | ||
| retention-days: 90 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,7 +134,7 @@ jobs: | |
|
|
||
| - name: Create build report | ||
| run: | | ||
| cat > BUILD_REPORT.md << 'EOF' | ||
| cat > BUILD_REPORT.md << EOF | ||
| # OpenSSL 3.5.4 Windows Build Report | ||
|
|
||
| ## Build Date | ||
|
Comment on lines
134
to
140
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🟠 OpenSSL build report heredoc uses unescaped $(...) command substitution that will not execute inside a single-quoted heredoc In the 'Create build report' step (combine-artifacts job), changed the heredoc delimiter from the quoted 🤖 Prompt for AI agentsfix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer |
||
|
|
@@ -163,19 +163,19 @@ jobs: | |
|
|
||
| ## Build Configuration | ||
| All builds use identical OpenSSL configure options: | ||
| ``` | ||
| \`\`\` | ||
| no-weak-ssl-ciphers no-srp no-psk no-comp no-zlib no-zlib-dynamic | ||
| no-threads no-err no-dso no-shared no-asm no-rc5 no-idea | ||
| no-md4 no-rmd160 no-ssl no-ssl3 no-seed no-camellia no-bf no-cast | ||
| no-md2 no-mdc2 | ||
| ``` | ||
| \`\`\` | ||
|
|
||
| ## Compiler | ||
| - Visual Studio 2022 (MSVC) | ||
| - Static runtime linking (/MT and /MTd) | ||
|
|
||
| ## GitHub Actions Workflow | ||
| Built using: `.github/workflows/build-openssl-windows.yml` | ||
| Built using: \`.github/workflows/build-openssl-windows.yml\` | ||
|
|
||
| EOF | ||
|
|
||
|
|
@@ -185,3 +185,4 @@ jobs: | |
| name: build-report | ||
| path: BUILD_REPORT.md | ||
| retention-days: 90 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| import argparse | ||
| import os | ||
| import subprocess | ||
| import re | ||
| import sys | ||
|
|
||
| # Label mappings | ||
| LABELS = { | ||
|
|
@@ -54,6 +56,10 @@ def apply_label(filepath, platform): | |
| if platform not in LABELS: | ||
| return False | ||
|
|
||
| if sys.platform != 'darwin': | ||
| print(f"Error applying label to {filepath}: Finder labels via xattr are only supported on macOS") | ||
| return False | ||
|
|
||
| label_hex, label_name = LABELS[platform] | ||
| hex_value = f"000000000000000000{label_hex}00000000000000000000000000000000000000000000" | ||
|
|
||
|
Comment on lines
56
to
65
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🔵 apply_labels.py uses macOS-only xattr/Finder labeling with no cross-platform guard In 🤖 Prompt for AI agentsfix confidence: 🟡 75 medium — react 👍/👎 to teach the reviewer |
||
|
|
@@ -69,7 +75,15 @@ def apply_label(filepath, platform): | |
| return False | ||
|
|
||
| def main(): | ||
| doc_dir = '/Users/peet/GitHub/MeshAgent_installer/bin/modules_documentation' | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument( | ||
| 'doc_dir', | ||
| nargs='?', | ||
| default=os.path.join(os.path.dirname(os.path.abspath(__file__)), 'modules_documentation'), | ||
| help='Directory containing module documentation markdown files' | ||
| ) | ||
| args = parser.parse_args() | ||
| doc_dir = args.doc_dir | ||
|
|
||
| print("Processing module documentation files...") | ||
| print("=" * 60) | ||
|
Comment on lines
75
to
89
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🟠 apply_labels.py hardcodes a developer's local macOS path, making the script unusable elsewhere In 🤖 Prompt for AI agentsfix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,7 @@ int write_JPEG_buffer(JSAMPLE * image_buffer, int image_width, int image_height, | |
|
|
||
| jpeg_create_compress(&cinfo); | ||
| cinfo.dest = (struct jpeg_destination_mgr *) malloc(sizeof(struct jpeg_destination_mgr)); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🔴 write_JPEG_buffer has no loop-exit check for row_pointer writes, unconditional infinite risk absent but return code always 0 In write_JPEG_buffer (linux_compression.c), added a NULL check immediately after 🤖 Prompt for AI agentsfix confidence: 🟡 75 medium — react 👍/👎 to teach the reviewer |
||
| if (cinfo.dest == NULL) { ILIBCRITICALEXIT(254); } | ||
| cinfo.dest->init_destination = &init_destination; | ||
| cinfo.dest->empty_output_buffer = &empty_output_buffer; | ||
| cinfo.dest->term_destination = &term_destination; | ||
|
|
@@ -132,3 +133,4 @@ int write_JPEG_buffer(JSAMPLE * image_buffer, int image_width, int image_height, | |
|
|
||
| return 0; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,7 +85,13 @@ int info_GetLocalInterfaces(char* data, int maxdata) | |
| pAdapterInfo = (IP_ADAPTER_INFO *)malloc(sizeof(IP_ADAPTER_INFO)); | ||
| if (pAdapterInfo == NULL) return 0; | ||
| ulOutBufLen = sizeof(IP_ADAPTER_INFO); | ||
| if (GetAdaptersInfo(pAdapterInfo, &ulOutBufLen) != ERROR_SUCCESS) { free(pAdapterInfo); if (ulOutBufLen == 0) return 0; pAdapterInfo = (IP_ADAPTER_INFO *)malloc(ulOutBufLen); } | ||
| if (GetAdaptersInfo(pAdapterInfo, &ulOutBufLen) != ERROR_SUCCESS) | ||
| { | ||
| free(pAdapterInfo); | ||
| if (ulOutBufLen == 0) return 0; | ||
| pAdapterInfo = (IP_ADAPTER_INFO *)malloc(ulOutBufLen); | ||
| if (pAdapterInfo == NULL) return 0; | ||
| } | ||
|
|
||
| // Get the list of all local interfaces | ||
| if ((dwRetVal = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen)) != ERROR_SUCCESS || ulOutBufLen == 0) { free(pAdapterInfo); return 0; } | ||
|
Comment on lines
85
to
97
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🔴 info_GetLocalInterfaces (Windows) leaks pAdapterInfo/pAdapterAddresses on realloc failure paths and does not check malloc failures In info_GetLocalInterfaces (Windows/WINSOCK2 branch), added NULL checks after the secondary 🤖 Prompt for AI agentsfix confidence: 🟡 85 medium — react 👍/👎 to teach the reviewer |
||
|
|
@@ -107,6 +113,7 @@ int info_GetLocalInterfaces(char* data, int maxdata) | |
| return 0; | ||
| } | ||
| pAdapterAddresses = (IP_ADAPTER_ADDRESSES *)malloc(ulOutBufLen); | ||
| if (pAdapterAddresses == NULL) { free(pAdapterInfo); return 0; } | ||
| } | ||
|
|
||
| // Get the list of all local interfaces | ||
|
|
@@ -366,9 +373,9 @@ int info_GetLocalInterfaces(char* data, int maxdata) | |
| { | ||
| ++size; | ||
| // realloc buffer size until no overflow occurs | ||
| if ((ifc.ifc_req = realloc(ifc.ifc_req, IFRSIZE)) == NULL) return 0; | ||
| if ((ifc.ifc_req = realloc(ifc.ifc_req, IFRSIZE)) == NULL) { close(sockfd); return 0; } | ||
| ifc.ifc_len = IFRSIZE; | ||
| if (ioctl(sockfd, SIOCGIFCONF, &ifc) != 0) return 0; | ||
| if (ioctl(sockfd, SIOCGIFCONF, &ifc) != 0) { free(ifc.ifc_req); close(sockfd); return 0; } | ||
| } while (IFRSIZE <= ifc.ifc_len); | ||
|
|
||
| ifr = ifc.ifc_req; | ||
|
Comment on lines
373
to
381
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🟠 POSIX info_GetLocalInterfaces leaks ifc.ifc_req on early-return paths before the loop In the POSIX branch of info_GetLocalInterfaces, the do/while loop that grows 🤖 Prompt for AI agentsfix confidence: 🟡 80 medium — react 👍/👎 to teach the reviewer |
||
|
|
@@ -650,3 +657,4 @@ int MeshInfo_PowerState(enum AgentPowerStateActions flg, int force) | |
|
|
||
| #endif | ||
| #endif | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,9 +3,9 @@ OpenFrame File Logger - Duplicates printf to both console and file | |
| Usage: Call enable_file_logging() at the start of main() | ||
|
|
||
| Features: | ||
| - Single log file: meshagent.log | ||
| - Single log file: meshcentral-agent.log | ||
| - Auto-rotation at 10MB | ||
| - Keeps only 1 archive (meshagent.log.old.gz) | ||
| - Keeps only 1 archive (meshcentral-agent.log.old.gz) | ||
| */ | ||
|
|
||
| #ifndef OPENFRAME_FILE_LOGGER_H | ||
|
Comment on lines
3
to
11
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🔵 openframe_file_logger.h header comment/macro names disagree with actual LOG_FILENAME value Updated the top-of-file doc comment (lines 5-7) to say "meshcentral-agent.log" and "meshcentral-agent.log.old.gz" instead of "meshagent.log" and "meshagent.log.old.gz", matching the actual LOG_FILENAME/LOG_ARCHIVE_FILENAME macro values. Left the runtime log messages ("MeshAgent Log Started", etc.) unchanged since the finding only flagged the header doc comment as stale/misleading, and changing user-visible log text was out of scope for a minimal fix. 🤖 Prompt for AI agentsfix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer |
||
|
|
@@ -39,6 +39,7 @@ Usage: Call enable_file_logging() at the start of main() | |
| #include <io.h> | ||
| #include <fcntl.h> | ||
| #include <sys/stat.h> | ||
| #include <zlib.h> | ||
| #endif | ||
|
|
||
| /* Macro to ignore return values */ | ||
|
|
@@ -173,30 +174,6 @@ static inline long get_file_size(const char* filepath) { | |
| } | ||
|
|
||
| static inline int compress_file_to_gzip(const char* source_path, const char* dest_path) { | ||
| #ifdef WIN32 | ||
| FILE* src = fopen(source_path, "rb"); | ||
| FILE* dst = fopen(dest_path, "wb"); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🟠 compress_file_to_gzip WIN32 branch never actually gzip-compresses; produces a plain-copy "archive" with .gz extension and misleading fallback semantics In compress_file_to_gzip(), removed the WIN32-only plain-copy branch (which used fopen/fwrite with no compression) and replaced the entire function with the single zlib-based implementation (fopen + gzopen/gzwrite/gzclose) that was previously only compiled for non-WIN32. Added 🤖 Prompt for AI agentsfix confidence: 🟡 75 medium — react 👍/👎 to teach the reviewer |
||
| char buffer[8192]; | ||
| size_t bytes; | ||
|
|
||
| if (!src || !dst) { | ||
| if (src) fclose(src); | ||
| if (dst) fclose(dst); | ||
| return 0; | ||
| } | ||
|
|
||
| while ((bytes = fread(buffer, 1, sizeof(buffer), src)) > 0) { | ||
| if (fwrite(buffer, 1, bytes, dst) != bytes) { | ||
| fclose(src); | ||
| fclose(dst); | ||
| return 0; | ||
| } | ||
| } | ||
|
|
||
| fclose(src); | ||
| fclose(dst); | ||
| return 1; | ||
| #else | ||
| FILE* src = fopen(source_path, "rb"); | ||
| gzFile dst = gzopen(dest_path, "wb9"); | ||
| char buffer[8192]; | ||
|
|
@@ -219,7 +196,6 @@ static inline int compress_file_to_gzip(const char* source_path, const char* des | |
| fclose(src); | ||
| gzclose(dst); | ||
| return 1; | ||
| #endif | ||
| } | ||
|
|
||
| static inline int rotate_log_file(void) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -286,7 +286,7 @@ void ILibAsyncUDPSocket_SetMulticastTTL(ILibAsyncUDPSocket_SocketModule module, | |
| { | ||
| struct sockaddr_in6 localAddress; | ||
| #if defined(__SYMBIAN32__) | ||
| return 0; | ||
| return; | ||
| #else | ||
| #if defined(WIN32) || defined(_WIN32_WCE) | ||
| SOCKET s = *((SOCKET*)ILibAsyncSocket_GetSocket(module)); | ||
|
Comment on lines
286
to
292
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🔵 return 0 used inside void-returning ILibAsyncUDPSocket_SetMulticastTTL under SYMBIAN32 guard In ILibAsyncUDPSocket_SetMulticastTTL, changed (Automatically downgraded: no change in this fix lands near this finding's line — verify whether it was actually addressed.) 🤖 Prompt for AI agentsfix confidence: 🔴 40 low — review closely — react 👍/👎 to teach the reviewer |
||
|
|
@@ -310,3 +310,4 @@ void ILibAsyncUDPSocket_SetMulticastLoopback(ILibAsyncUDPSocket_SocketModule mod | |
| ILibAsyncSocket_GetLocalInterface(module, (struct sockaddr*)&localAddress); | ||
| if (setsockopt(s, localAddress.sin6_family == PF_INET6 ? IPPROTO_IPV6 : IPPROTO_IP, localAddress.sin6_family == PF_INET6 ? IPV6_MULTICAST_LOOP : IP_MULTICAST_LOOP, (char*)&loopback, sizeof(loopback)) != 0) ILIBCRITICALERREXIT(253); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,7 +169,6 @@ int ILibMulticastSocket_ResetMulticast(struct ILibMulticastSocket_StateModule *m | |
| #if !defined(NACL) | ||
| if (setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&(module->TTL), sizeof(int)) != 0) ILIBCRITICALERREXIT(253); | ||
| if (setsockopt(socket, IPPROTO_IP, IP_MULTICAST_LOOP, (const char*)&(module->Loopback), sizeof(int)) != 0) ILIBCRITICALERREXIT(253); | ||
| if (setsockopt(socket, IPPROTO_IP, IP_MULTICAST_LOOP, (const char*)&(module->Loopback), sizeof(int)) != 0) ILIBCRITICALERREXIT(253); | ||
| #endif | ||
| module->AddressListV4[i].sin_port = 0; | ||
|
|
||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🟠 Duplicate IP_MULTICAST_LOOP setsockopt call, missing IP_MULTICAST_TTL-equivalent redundancy is a copy/paste bug In 🤖 Prompt for AI agentsfix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer |
||
|
|
@@ -214,7 +213,7 @@ void ILibMulticastSocket_BroadcastUdpPacketV4(struct ILibMulticastSocket_StateMo | |
| #ifndef NACL | ||
| if (module->UDPServers[i] != NULL) | ||
| { | ||
| socket = ILibAsyncUDPSocket_GetSocket(module->UDPServer); | ||
| socket = ILibAsyncUDPSocket_GetSocket(module->UDPServers[i]); | ||
| setsockopt(socket, IPPROTO_IP, IP_MULTICAST_IF, (const char*)&(module->AddressListV4[i].sin_addr), sizeof(struct in_addr)); | ||
| setsockopt(socket, IPPROTO_IP, IP_MULTICAST_TTL, (const char*)&(module->TTL), sizeof(int)); | ||
| for (j = 0; j < count; j++) sendto(socket, data, datalen, 0, (struct sockaddr*)addr, sizeof(struct sockaddr_in)); | ||
|
Comment on lines
213
to
219
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🦩 🟠 Broadcast helper uses shared module->UDPServer socket instead of the per-interface socket it just checked In 🤖 Prompt for AI agentsfix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer |
||
|
|
@@ -397,3 +396,4 @@ void ILibMulticastSocket_WakeOnLan(void *module, char* mac) | |
| ILibMulticastSocket_Broadcast((struct ILibMulticastSocket_StateModule*)module, ILibScratchPad, 102, 1); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🦩 🟠 build-openssl-linux.yml BUILD_REPORT.md heredoc uses unescaped$(date) and $ (ls) expansions that will not execute inside a quoted heredoc
In the "Create build report" step of the
combine-artifactsjob, changed the heredoc delimiter from quoted<< 'EOF'to unquoted<< EOFso that$(date ...)and$(ls ...)command substitutions are actually evaluated by the shell when generating BUILD_REPORT.md. Since unquoting the delimiter also re-enables expansion of literal backticks/$/backslashes elsewhere in the body, I escaped the two Markdown code-fence backtick sequences (```) and the inline code backticks around the workflow filename with backslashes (\``and`...``) so they are emitted literally instead of being misinterpreted, preserving the rest of the report text unchanged.(Automatically downgraded: no change in this fix lands near this finding's line — verify whether it was actually addressed.)
🤖 Prompt for AI agents
fix confidence: 🔴 40 low — review closely — react 👍/👎 to teach the reviewer