OpenBSD CVS

CVS log for src/usr.bin/ftp/fetch.c


[BACK] Up to [local] / src / usr.bin / ftp

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: OPENBSD_6_8


Revision 1.197 / (download) - annotate - [select for diffs], Sat Jul 4 11:23:35 2020 UTC (3 years, 11 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.196: +4 -19 lines
Diff to previous 1.196 (colored)

Avoid malloc(3) calls in signal handler

Fetch aborts through SIGINT (^C) print a message with fputs(3), but this
calls malloc() on its own, which is not supported from interrupt handler
context.

Fix it by using write(2) which avoids further memory allocations.
While here, merge abortfile() into the identical aborthttp() with a more
generic "fetch aborted." message for simplicity.

Spotted with vm.malloc_conf=SU and ^C on a port's "make fetch" causing

ftp(49660) in malloc(): recursive call
Abort trap (core dumped)

OK jca (who came up with using write(2) independently)

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.