summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2023-07-03 18:17:41 +0200
committerDave Davenport <qball@blame.services>2023-07-03 18:17:41 +0200
commit91dbcab45a043be7ca49055b0722f5089ccb6bdc (patch)
treee3ab545e55f812c0a5ff1bb146fc488f9826ae08
parentb20f0ab22eed782cc5d4a02675a2c0dd6471853d (diff)
parent64ceb85eed1c1f3aed33a3d3d224b18c07080bc0 (diff)
Merge remote-tracking branch 'origin/next' into rn
-rw-r--r--.github/workflows/codeql.yml57
-rw-r--r--source/modes/script.c2
-rw-r--r--source/modes/window.c10
3 files changed, 66 insertions, 3 deletions
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 00000000..911d91b7
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,57 @@
+name: "CodeQL"
+
+on:
+ push:
+ branches: [ 'next', 'master' ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [ 'next' ]
+ schedule:
+ - cron: '59 13 * * 3'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'cpp' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
+ # Use only 'java' to analyze code written in Java, Kotlin or both
+ # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ with:
+ submodules: recursive
+
+ - uses: ./.github/actions/setup
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ # queries: security-extended,security-and-quality
+
+ - uses: ./.github/actions/meson
+ with:
+ cc: gcc
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
+ with:
+ category: "/language:${{matrix.language}}"
diff --git a/source/modes/script.c b/source/modes/script.c
index f1f87486..92ec95ef 100644
--- a/source/modes/script.c
+++ b/source/modes/script.c
@@ -576,6 +576,7 @@ Mode *script_mode_parse_setup(const char *str) {
sw->_get_icon = script_get_icon;
sw->_get_completion = NULL, sw->_preprocess_input = NULL,
sw->_get_display_value = _get_display_value;
+ sw->type = MODE_TYPE_SWITCHER;
return sw;
}
Mode *sw = g_malloc0(sizeof(*sw));
@@ -599,6 +600,7 @@ Mode *script_mode_parse_setup(const char *str) {
sw->_get_icon = script_get_icon;
sw->_get_completion = NULL, sw->_preprocess_input = NULL,
sw->_get_display_value = _get_display_value;
+ sw->type = MODE_TYPE_SWITCHER;
return sw;
}
diff --git a/source/modes/window.c b/source/modes/window.c
index 91ad3fc7..1d93e957 100644
--- a/source/modes/window.c
+++ b/source/modes/window.c
@@ -968,10 +968,14 @@ static cairo_user_data_key_t data_key;
* \param data The image's data in ARGB format, will be copied by this
* function.
*/
-static cairo_surface_t *draw_surface_from_data(int width, int height,
+static cairo_surface_t *draw_surface_from_data(uint32_t width, uint32_t height,
uint32_t const *const data) {
- unsigned long int len = width * height;
- unsigned long int i;
+ // limit surface size.
+ if ( width >= 65536 || height >= 65536){
+ return NULL;
+ }
+ uint32_t len = width * height;
+ uint32_t i;
uint32_t *buffer = g_new0(uint32_t, len);
cairo_surface_t *surface;