Comments (6)
Sure. Closing this issue then. Thanks for taking a look!
from yash.
Thanks for the report, but I have difficulty interpreting the message from the address sanitizer.
The third parameter to the wcsnrtombs
function is of type size_t
, which is an unsigned integer and can't be negative.
The parameter specifies the maximum number of characters to be converted, which is irrelevant to the actual size of arrays involved. Maybe the sanitizer is incorrectly configured to perform some check about this parameter?
PS: To print a size_t
value, you should be using %zu
rather than %ld
.
from yash.
You are right. After further investigation, this seems to be a bug in AddressSanitizer. google/sanitizers#1524
However, this makes me wonder if wcsrtombs
should be used instead when size is not specified. We don't have a buffer as big as Size_max
anyway, and size_t len
is still there to prevent buffer overflow. Why use such a large number here?
from yash.
Defining sb_wcscat
as a special case of sb_wcsncat
is much simpler than defining them as separate functions that are very similar but differ only in one line that calls either wcsrtombs
or wcsnrtombs
.
sb_wcscat
is defined as: https://github.com/magicant/yash/blob/2e02670ad531ea8ac445217ce70d32915c736709/strbuf.h#L322C1-L328
from yash.
Defining
sb_wcscat
as a special case ofsb_wcsncat
is much simpler than defining them as separate functions that are very similar but differ only in one line that calls eitherwcsrtombs
orwcsnrtombs
.
Yes, but we already have sb_wcscat
and malloc_wcstombs
for systems without wcsnrtombs
anyway. Could they be enabled on all systems?
Lines 233 to 236 in 2e02670
from yash.
Hmm, I don't want to bloat the binary just to make the misbehaving analyzer happy.
from yash.
Related Issues (20)
- Non-interactive shell should not ignore stop signals
- Result of tilde expansion in nested parameter expansion
- 'typeset' and family accept invalid identifiers
- Cannot expand `${0_1}`
- Orphan trailing backslash in pattern
- Numeric brace expansion containing parameter
- Filtering completion candidates incrementally
- seg fault in alt+c completion HOT 6
- Many linting errors on man page. HOT 2
- Build warnings on OpenBSD. HOT 9
- for loop wrong exit status HOT 5
- doas completion
- b$ is printed when resizing kitty HOT 5
- Post-prompt command HOT 2
- filename completion with tab inserts additional backslash if started from one HOT 4
- Support for cross compilation HOT 2
- fsplit-p.tst: export IFS influences run-test.sh HOT 2
- Accidentally pressing escape will wreck interactive input until next Ctrl+C HOT 2
- Yash Throws: yash: parameter `DIRENV_DIR' is not set When Accounted For HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yash.