FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-106693: Explicitly mark ob_sval as unsigned char to avoid UB by pablogsal · Pull Request #106826 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .h  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions Include/cpython/bytesobject.h
Show comments Show annotations View file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
typedef struct {
PyObject_VAR_HEAD
Py_DEPRECATED(3.11) Py_hash_t ob_shash;
char ob_sval[1];
unsigned char ob_sval[1];

/* Invariants:
* ob_sval contains space for 'ob_size+1' elements.
Expand All @@ -20,11 +20,11 @@
#define _PyBytes_CAST(op) \
(assert(PyBytes_Check(op)), _Py_CAST(PyBytesObject*, op))

static inline char* PyBytes_AS_STRING(PyObject *op)
static inline unsigned char* PyBytes_AS_STRING(PyObject *op)
{
return _PyBytes_CAST(op)->ob_sval;
}
#define PyBytes_AS_STRING(op) PyBytes_AS_STRING(_PyObject_CAST(op))

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Cross build Linux

pointer targets in passing argument 1 of ‘_PyLong_FromBytes’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Cross build Linux

pointer targets in passing argument 1 of ‘_PyLong_FromBytes’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Cross build Linux

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Cross build Linux

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Cross build Linux

pointer targets in passing argument 1 of ‘PyUnicode_Decode’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Cross build Linux

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Cross build Linux

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Cross build Linux

pointer targets in initialization of ‘const char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

pointer targets in passing argument 1 of ‘PyUnicode_Decode’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

pointer targets in passing argument 1 of ‘PyUnicode_Decode’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

pointer targets in passing argument 1 of ‘_PyLong_FromBytes’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

pointer targets in passing argument 1 of ‘_PyLong_FromBytes’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

pointer targets in passing argument 1 of ‘PyUnicode_Decode’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

pointer targets in initialization of ‘const char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

pointer targets in passing argument 1 of ‘PyUnicode_Decode’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

pointer targets in passing argument 1 of ‘_PyLong_FromBytes’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

pointer targets in passing argument 1 of ‘PyUnicode_Decode’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

pointer targets in initialization of ‘const char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

pointer targets in passing argument 1 of ‘PyUnicode_Decode’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

pointer targets in initialization of ‘char *’ from ‘unsigned char *’ differ in signedness [-Wpointer-sign]

Check warning on line 27 in Include/cpython/bytesobject.h

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

pointer targets in passing argument 1 of ‘PyUnicode_Decode’ differ in signedness [-Wpointer-sign]

static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
PyBytesObject *self = _PyBytes_CAST(op);
Expand Down
Loading

Back | FazBrowse Home | New Git URL