stack trace for bug #755
Linus Torvalds
torvalds at linux-foundation.org
Tue Nov 11 11:20:30 PST 2014
On Tue, Nov 11, 2014 at 5:45 AM, Miika Turkia <miika.turkia at gmail.com> wrote:
>
> And the line calling strdup (in case my sources are slightly off sync):
>
> if (!same_string(displayedTrip.location, currentTrip->location)) {
> currentTrip->location = strdup(displayedTrip.location);
> mark_divelist_changed(true);
> }
That "strdup()" really should be "copy_string()".
The whole "same_string()" thing counts NULL as en empty string, so it
allows NULL. And that's *exactly* why we have "copy_string()" too,
allowing NULL (which will be copied as NULL).
Linus
More information about the subsurface
mailing list