Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Size of buffer passed to f_FUNCTION?

May
13,040
175
I couldn't find it documented. Experiment says 16K (WCHARS). Is that correct?
 
I couldn't find it documented. Experiment says 16K (WCHARS). Is that correct?
In my tests associated with this question, using LPWSTR psz as argument to f_FUNCTION, TCC did not catch my writing beyond the end of the buffer pointed to by psz (and TCC crashed). Should it have caught such an error?
 
I couldn't find it documented. Experiment says 16K (WCHARS). Is that correct?

I seem to recall this value changing from one version to another.... Even if you know for sure that it's 16K in the current release, it may well be smaller in older versions.
 
I couldn't find it documented. Experiment says 16K (WCHARS). Is that correct?

I have no idea what you're asking about -- what is "f_FUNCTION"?

If you're asking about the size of the buffer passed to a plugin function or command, it's 32K bytes (and always has been), regardless of whether it's a function or command.

TCC itself has no limits on string sizes, but I can't change it in the plugin calls without breaking every plugin in existence.

And no, TCC can't do anything about an ill-behaved plugin writing beyond the end of memory. There is no automagical way to uncorrupt a heap.

(And TCC didn't crash, your plugin did. If you neglected to include exception handling, you could take the TCC process down as well.)
 
Last edited:
OK, thanks ... just curious. I didn't want anything to change.
 
Back
Top
[FOX] Ultimate Translator
Translate