Fossil SCM
minor buffer length fix for the previous change
Commit
091499ec1a4002f7e2860c5b10fb5628a3f8be39
Parent
6b78df386170d9b…
1 file changed
+3
-3
+3
-3
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -304,23 +304,23 @@ | ||
| 304 | 304 | ** buffer for the prefix + current file name. zHead keeps track |
| 305 | 305 | ** of where we should write file names to this buffer. |
| 306 | 306 | */ |
| 307 | 307 | if( manifest_parse(&m, &mfile) ){ |
| 308 | 308 | zip_set_timedate(m.rDate); |
| 309 | - snprintf( zHead, bufsize, "manifest" ); | |
| 309 | + snprintf( zHead, bufsize-prxLen, "manifest" ); | |
| 310 | 310 | zip_add_file(aSBuf, &file); |
| 311 | 311 | sha1sum_blob(&file, &hash); |
| 312 | 312 | blob_reset(&file); |
| 313 | 313 | blob_append(&hash, "\n", 1); |
| 314 | - snprintf( zHead, bufsize, "manifest.uuid" ); | |
| 314 | + snprintf( zHead, bufsize-prxLen, "manifest.uuid" ); | |
| 315 | 315 | zip_add_file(aSBuf, &hash); |
| 316 | 316 | blob_reset(&hash); |
| 317 | 317 | for(i=0; i<m.nFile; i++){ |
| 318 | 318 | int fid = uuid_to_rid(m.aFile[i].zUuid, 0); |
| 319 | 319 | if( fid ){ |
| 320 | 320 | content_get(fid, &file); |
| 321 | - snprintf( zHead, bufsize, "%s", m.aFile[i].zName ); | |
| 321 | + snprintf( zHead, bufsize-prxLen, "%s", m.aFile[i].zName ); | |
| 322 | 322 | zip_add_file( aSBuf, &file); |
| 323 | 323 | blob_reset(&file); |
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | manifest_clear(&m); |
| 327 | 327 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -304,23 +304,23 @@ | |
| 304 | ** buffer for the prefix + current file name. zHead keeps track |
| 305 | ** of where we should write file names to this buffer. |
| 306 | */ |
| 307 | if( manifest_parse(&m, &mfile) ){ |
| 308 | zip_set_timedate(m.rDate); |
| 309 | snprintf( zHead, bufsize, "manifest" ); |
| 310 | zip_add_file(aSBuf, &file); |
| 311 | sha1sum_blob(&file, &hash); |
| 312 | blob_reset(&file); |
| 313 | blob_append(&hash, "\n", 1); |
| 314 | snprintf( zHead, bufsize, "manifest.uuid" ); |
| 315 | zip_add_file(aSBuf, &hash); |
| 316 | blob_reset(&hash); |
| 317 | for(i=0; i<m.nFile; i++){ |
| 318 | int fid = uuid_to_rid(m.aFile[i].zUuid, 0); |
| 319 | if( fid ){ |
| 320 | content_get(fid, &file); |
| 321 | snprintf( zHead, bufsize, "%s", m.aFile[i].zName ); |
| 322 | zip_add_file( aSBuf, &file); |
| 323 | blob_reset(&file); |
| 324 | } |
| 325 | } |
| 326 | manifest_clear(&m); |
| 327 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -304,23 +304,23 @@ | |
| 304 | ** buffer for the prefix + current file name. zHead keeps track |
| 305 | ** of where we should write file names to this buffer. |
| 306 | */ |
| 307 | if( manifest_parse(&m, &mfile) ){ |
| 308 | zip_set_timedate(m.rDate); |
| 309 | snprintf( zHead, bufsize-prxLen, "manifest" ); |
| 310 | zip_add_file(aSBuf, &file); |
| 311 | sha1sum_blob(&file, &hash); |
| 312 | blob_reset(&file); |
| 313 | blob_append(&hash, "\n", 1); |
| 314 | snprintf( zHead, bufsize-prxLen, "manifest.uuid" ); |
| 315 | zip_add_file(aSBuf, &hash); |
| 316 | blob_reset(&hash); |
| 317 | for(i=0; i<m.nFile; i++){ |
| 318 | int fid = uuid_to_rid(m.aFile[i].zUuid, 0); |
| 319 | if( fid ){ |
| 320 | content_get(fid, &file); |
| 321 | snprintf( zHead, bufsize-prxLen, "%s", m.aFile[i].zName ); |
| 322 | zip_add_file( aSBuf, &file); |
| 323 | blob_reset(&file); |
| 324 | } |
| 325 | } |
| 326 | manifest_clear(&m); |
| 327 |