Ticket #2896 (closed defect: fixed)
GetFieldAsString() fails (aborts) on Ubuntu 8.10
| Reported by: | rouault | Owned by: | rouault |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.5.5 |
| Component: | OGR_SF | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | warmerdam |
Description
It appears that in Ubuntu 8.10 and later versions, -D_FORTIFY_SOURCE=2 is set by default, and is activated when -O is set to 2 or higher. This enables additional compile-time and run-time checks for several libc functions.
The consequence of this is that :
int main()
{
char s[5];
snprintf(s, 100, "%d", 1234);
printf("%s\n", s);
return 0;
}
will ABORT when it is compiled in -O2 (unless -U_FORTIFY_SOURCE or -D_FORTIFY_SOURCE=0 are defined)
We have a similar pattern in ogr_feature.cpp.
Change History
Note: See
TracTickets for help on using
tickets.
