Commit bda03d1
committed
i2c: fix ioctl buffer size
The I2C_FUNCS ioctl expects an unsigned long output argument[1].
However, we currently create a buffer using the 'I' (unsigned int)
specifier. On platforms where sizeof(unsigned int) < sizeof(unsigned
long), this results in a buffer that is too small.
This has always been a problem but with Python 3.14, the ioctl interface
has some logic to detect this kind of buffer overflow[2], causing a
SystemError to be raised when trying to create a new I2C object.
Fix the type specifier to align with what the ioctl expects.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/i2c/dev-interface.rst?h=v7.0-rc2#n124
[2] python/cpython@c2eaeee1 parent c3b9d0f commit bda03d1
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
0 commit comments