Quantcast
Channel: User Hasturkun - Stack Overflow
Browsing all 49 articles
Browse latest View live

Comment by Hasturkun on whay is my LD compaling about a invalid...

Related: stackoverflow.com/q/64679192

View Article



Comment by Hasturkun on Asan: stack-use-after-return: want to learn more...

I suggest you read this related answer, as well as AddressSanitizerAlgorithm which it links. As for the shadow bytes themselves, your program should never try to access these directly.

View Article

Comment by Hasturkun on What techniques can I use to determine the number...

Use a fixed seed? Don't use a PRNG if you're expecting a specific value? Use a second program to fetch the same value? Don't use a PRNG as a password? Override rand() using LD_PRELOAD with a library...

View Article

Comment by Hasturkun on Initialize char array with a Pascal string

Would type punning through a union be acceptable? (Technically implementation defined behavior, but matching a {char len; char string[19];} and char pstring[20]; is probably safe)

View Article

Comment by Hasturkun on Issue with std::swap when using it inside copy...

related, goes into why using std::swap explicitly fails, and what you should be doing (namely, using std::swap in the scope, and calling swap instead of std::swap).

View Article


Comment by Hasturkun on How to reference a Git commit by message text under...

The Msys2 documentation you linked does seem to suggest that running the command as MSYS2_ARG_CONV_EXCL='*' git... (to disable all expansion) or possibly MSYS2_ARG_CONV_EXCL=':/' git... might work.

View Article

Comment by Hasturkun on Inject additional hints into `COMMIT_EDITMSG` during...

The documentation tells you that the second argument to the hook being message indicates that -m or -F were used (similarly, commit for -c). You can base your decision on that.

View Article

Comment by Hasturkun on When should I manually unlock the mutex before...

For the case where it's better to notify first and then unlock, there's notify_all_at_thread_exit which has an LWG issue demonstrating the case where the condition variable may be destroyed if the...

View Article


Comment by Hasturkun on What is the CARD variable type in XRANDR?

See also the X11 specification which indicates that CARD32/16/8 are 32/16/8 bit unsigned integer types respectively. (Also, I see no reference to CARD4 anywhere)

View Article


Comment by Hasturkun on how can I create git bundle between 2 commits and...

I think you should be able to use git log to fetch the tags in the range to generate the list (instead of doing it manually) and append that to the command (and could probably create a wrapper to...

View Article

Comment by Hasturkun on Is there a way to make git log show specific amount...

Getting the nth ancestor of a commit is fairly easy, you can just use, e.g. revision~5 refers to the 5th generation ancestor of revision. You could probably combine that with git log's -n, etc., to...

View Article

Answer by Hasturkun for How to apply LD_PRELOAD only to target program?

It looks like you can set QEMU_SET_ENV=LD_PRELOAD=./malloc.so in the environment to affect the process.I'll note that you can similarly unset environment variables for the target by setting...

View Article

Answer by Hasturkun for AFL-GCC compiles differently than GCC

Re: Why the compilation with gcc and with afl-gcc is different, a short look at the afl-gcc source shows that by default it modifies the compiler parameters, setting -O3 -funroll-loops (as well as...

View Article


Answer by Hasturkun for Implement custom stack canary handling without the...

It looks like the Arch gcc package (which the Manjaro package is based on) is turning off -fstack-protector when building without the standard library (Done for Arch bug 64270).This behavior is...

View Article

Answer by Hasturkun for How to version-sort git branch output (vs the usual...

You can ask git to do a version sort on refnames for you (as of git 2.7.0):git branch -a --sort=v:refname remotes/origin/foo_1_bar remotes/origin/foo_2_bar remotes/origin/foo_3_bar...

View Article


Answer by Hasturkun for Associative arrays in C

Try uthash, a header library implementing a hash table in C. It's small and fairly easy to use.

View Article

Answer by Hasturkun for In /proc/meminfo, which entries correspond to page...

It may be easier to find the running counters for swap in/out in /proc/vmstat as pswpin and pswpout (both are in pages since boot).Similarly in the same place you'll find pgpgin and pgpgout, which are...

View Article


Answer by Hasturkun for What does "corking" mean in "UDP tracks corking status"?

UDP_CORK is a UDP socket option that allows you to accumulate data, only transmitting itin a single datagram when the option is disabled.(There's also the similar MSG_MORE flag for send that behaves...

View Article

Answer by Hasturkun for SHA1 hash of git object calculated by my program not...

Your format string has a literal NUL ('\0') in it, so your last argument (the data) isn't being added (since C strings end at the first NUL).If you want sprintf to append the NUL, you'll have to use %c...

View Article

Answer by Hasturkun for Showing progress of scp during cloud-init process

Like some other tools, scp checks if its output is going to a TTY (by use of isatty), disabling the progress meter output if it is not (you can find similar cases e.g., ls --color=auto emits color...

View Article
Browsing all 49 articles
Browse latest View live




Latest Images