Bug 60000 - Potentially dangerous code in camlibs/sonydscf55/camera.c
Potentially dangerous code in camlibs/sonydscf55/camera.c
Status: CLOSED NOTABUG
Product: Red Hat Raw Hide
Classification: Retired
Component: gphoto2 (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-18 14:58 EST by Bernhard Rosenkraenzer
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-02-18 14:58:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bernhard Rosenkraenzer 2002-02-18 14:58:12 EST
Found this code while debugging kamera: 
 
for (i = 0; i < sizeof(models) / sizeof(models[i]); i++) { 
[...] 
} 
 
Since AFAIK the compiler is free to add arbitrary padding in structures and arrays, the 
behavior of this code is pretty much undefined.
Comment 1 Tim Waugh 2002-02-19 05:16:50 EST
Not so, from my interpretation of C99.  See example 2 (paragraph 6) of 6.5.3.4
"The sizeof operator".

Note You need to log in before you can comment on or make changes to this bug.