summaryrefslogtreecommitdiff
path: root/camlibs/mars
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2009-07-30 18:15:21 +0000
committerDan Fandrich <dan@coneharvesters.com>2009-07-30 18:15:21 +0000
commitf6c4c628f33aa999995b6fd11ea2e202c8b5c7d8 (patch)
tree4b744b348e65a1c887b07e954c16160c143a2c65 /camlibs/mars
parentea15780bdd129931837b32cc5c2ff12f76fbe83a (diff)
downloadlibgphoto2-f6c4c628f33aa999995b6fd11ea2e202c8b5c7d8.tar.gz
Fixed a bunch of C89 and SUS portability issues.
Fixed a buffer overflow in the AOX driver. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12305 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/mars')
-rw-r--r--camlibs/mars/mars.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/camlibs/mars/mars.c b/camlibs/mars/mars.c
index 0627750ea..0e439a47d 100644
--- a/camlibs/mars/mars.c
+++ b/camlibs/mars/mars.c
@@ -308,17 +308,30 @@ mars_routine (Info *info, GPPort *port, char param, int n)
char c[16];
char start[2] = {0x19, 0x51};
char do_something[2];
- /* See protocol.txt for my theories about what these mean. */
- char address1[2] = {0x19, info[8*n+1]};
- char address2[2] = {0x19, info[8*n+2]};
- char address3[2] = {0x19, info[8*n+3]};
- char address4[2] = {0x19, info[8*n+4]};
- char address5[2] = {0x19, info[8*n+5]};
- char address6[2] = {0x19, info[8*n+6]};
+ char address1[2];
+ char address2[2];
+ char address3[2];
+ char address4[2];
+ char address5[2];
+ char address6[2];
do_something[0]= 0x19;
do_something[1]=param;
+ /* See protocol.txt for my theories about what these mean. */
+ address1[0] = 0x19;
+ address1[1] = info[8*n+1];
+ address2[0] = 0x19;
+ address2[1] = info[8*n+2];
+ address3[0] = 0x19;
+ address3[1] = info[8*n+3];
+ address4[0] = 0x19;
+ address4[1] = info[8*n+4];
+ address5[0] = 0x19;
+ address5[1] = info[8*n+5];
+ address6[0] = 0x19;
+ address6[1] = info[8*n+6];
+
memset(c,0,sizeof(c));