Fossil SCM
Fixed a crash case off-by-1 in th1 (ob get).
Commit
ef68eb01069462e73cf214a1641adf582a7a6a63
Parent
960576b961031c0…
1 file changed
+1
-1
M
src/th.c
+1
-1
| --- src/th.c | ||
| +++ src/th.c | ||
| @@ -2927,11 +2927,11 @@ | ||
| 2927 | 2927 | int argPos = 2; |
| 2928 | 2928 | char const * sub; |
| 2929 | 2929 | int subL; |
| 2930 | 2930 | int rc = TH_OK; |
| 2931 | 2931 | Th_SetResult( interp, blob_str(b), b->nUsed ); |
| 2932 | - if(argc>=argPos){ | |
| 2932 | + if(argc>argPos){ | |
| 2933 | 2933 | sub = argv[argPos]; |
| 2934 | 2934 | subL = argl[argPos]; |
| 2935 | 2935 | /* "ob get clean" */ |
| 2936 | 2936 | if(!rc && th_strlen(sub)==5 && 0==memcmp("clean", sub, subL)){ |
| 2937 | 2937 | rc |= ob_clean_command(interp, ctx, argc-1, argv+1, argl+1); |
| 2938 | 2938 |
| --- src/th.c | |
| +++ src/th.c | |
| @@ -2927,11 +2927,11 @@ | |
| 2927 | int argPos = 2; |
| 2928 | char const * sub; |
| 2929 | int subL; |
| 2930 | int rc = TH_OK; |
| 2931 | Th_SetResult( interp, blob_str(b), b->nUsed ); |
| 2932 | if(argc>=argPos){ |
| 2933 | sub = argv[argPos]; |
| 2934 | subL = argl[argPos]; |
| 2935 | /* "ob get clean" */ |
| 2936 | if(!rc && th_strlen(sub)==5 && 0==memcmp("clean", sub, subL)){ |
| 2937 | rc |= ob_clean_command(interp, ctx, argc-1, argv+1, argl+1); |
| 2938 |
| --- src/th.c | |
| +++ src/th.c | |
| @@ -2927,11 +2927,11 @@ | |
| 2927 | int argPos = 2; |
| 2928 | char const * sub; |
| 2929 | int subL; |
| 2930 | int rc = TH_OK; |
| 2931 | Th_SetResult( interp, blob_str(b), b->nUsed ); |
| 2932 | if(argc>argPos){ |
| 2933 | sub = argv[argPos]; |
| 2934 | subL = argl[argPos]; |
| 2935 | /* "ob get clean" */ |
| 2936 | if(!rc && th_strlen(sub)==5 && 0==memcmp("clean", sub, subL)){ |
| 2937 | rc |= ob_clean_command(interp, ctx, argc-1, argv+1, argl+1); |
| 2938 |