The Following 2 Users Say Thank You to reinob For This Useful Post: | ||
|
2012-04-03
, 22:22
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#22
|
The Following 4 Users Say Thank You to Mentalist Traceur For This Useful Post: | ||
|
2012-04-04
, 07:29
|
Posts: 1,808 |
Thanked: 4,272 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: | ||
|
2012-04-04
, 07:51
|
Posts: 1,808 |
Thanked: 4,272 times |
Joined on Feb 2011
@ Germany
|
#24
|
The Following 3 Users Say Thank You to reinob For This Useful Post: | ||
|
2012-04-04
, 09:09
|
Posts: 1,523 |
Thanked: 1,997 times |
Joined on Jul 2011
@ not your mom's FOSS basement
|
#25
|
The Following 2 Users Say Thank You to don_falcone For This Useful Post: | ||
|
2012-04-04
, 09:17
|
Posts: 1,808 |
Thanked: 4,272 times |
Joined on Feb 2011
@ Germany
|
#26
|
The Following 4 Users Say Thank You to reinob For This Useful Post: | ||
|
2012-07-20
, 18:13
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#27
|
|
2012-07-20
, 20:56
|
Posts: 1,808 |
Thanked: 4,272 times |
Joined on Feb 2011
@ Germany
|
#28
|
The Following User Says Thank You to reinob For This Useful Post: | ||
|
2013-11-03
, 22:52
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#29
|
|
2013-11-04
, 06:38
|
Posts: 3,074 |
Thanked: 12,961 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#30
|
The Following 4 Users Say Thank You to freemangordon For This Useful Post: | ||
Tags |
command line, on device, r&d mode |
|
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!