| The Following 2 Users Say Thank You to reinob For This Useful Post: | ||
|
|
04-03-2012
, 06:22 PM
|
|
Posts: 1,983 |
Thanked: 2,975 times |
Joined on Jun 2010
@ Florida
|
#22
|
| The Following 4 Users Say Thank You to Mentalist Traceur For This Useful Post: | ||
|
|
04-04-2012
, 03:29 AM
|
|
Posts: 1,233 |
Thanked: 1,911 times |
Joined on Feb 2011
@ Germany
|
#23
|
struct cal *cal_s; .. if(cal_init(&cal_s) < 0 ..)
| The Following 3 Users Say Thank You to reinob For This Useful Post: | ||
|
|
04-04-2012
, 03:51 AM
|
|
Posts: 1,233 |
Thanked: 1,911 times |
Joined on Feb 2011
@ Germany
|
#24
|
| The Following 3 Users Say Thank You to reinob For This Useful Post: | ||
|
|
04-04-2012
, 05:09 AM
|
|
|
Posts: 1,465 |
Thanked: 1,890 times |
Joined on Jul 2011
@ not your mom's basement
|
#25
|
@Mentalist Traceur,
Just some off-line debugging.. maybe my comments don't solve anything, but as a "past" C programmer there are some things that hurt my eyes.
| The Following 2 Users Say Thank You to don_falcone For This Useful Post: | ||
|
|
04-04-2012
, 05:17 AM
|
|
Posts: 1,233 |
Thanked: 1,911 times |
Joined on Feb 2011
@ Germany
|
#26
|
| The Following 4 Users Say Thank You to reinob For This Useful Post: | ||
|
|
07-20-2012
, 02:13 PM
|
|
Posts: 1,983 |
Thanked: 2,975 times |
Joined on Jun 2010
@ Florida
|
#27
|
|
|
07-20-2012
, 04:56 PM
|
|
Posts: 1,233 |
Thanked: 1,911 times |
Joined on Feb 2011
@ Germany
|
#28
|

| The Following User Says Thank You to reinob For This Useful Post: | ||
![]() |
| Tags |
| command line, on device, r&d mode |
| Thread Tools | Search this Thread |
|
With cal_read_block() both tmp and len are initialized. rd_mode_string is, at that point, still not initialized (i.e. not a valid pointer).
Then you do if((len < 1) && !rd_mode_string) { ... }
so in principle this is invalid. I guess you want if( (len<1) || (tmp == NULL))
because it's tmp and len that get initialized/assigned by cal_read_block().
The && is important. It should be || (OR). Because, assuming rd_mode_string is hopefully initialized to NULL, you're only exiting if len < 1.
So it can happen that you're actually trying to read from tmp (rd_mode_string) when it's still NULL or uninitialized -> SIGSEGV!
I can't compile anything now (can only do useful "work" here when I'm at work, i.e. no compiler; at home I have the compiler, but no time
Try fixing those bugs.(I only looked at the "-q" code path) and post another compiled binary and I'll give it a try!