X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=aft.c;h=f66310968c67458898bef9edb377a41e68458e97;hb=49a0c1671a71a796ed4c794003e3bb96320e863c;hp=f55bf847d87575605dca3d0f14fd35799a00ca2b;hpb=c03bc512fc733c05292225cf878f14e41d1d59c9;p=paraslash.git diff --git a/aft.c b/aft.c index f55bf847..f6631096 100644 --- a/aft.c +++ b/aft.c @@ -723,8 +723,9 @@ int open_and_update_audio_file(struct osl_row *aft_row, struct audio_file_data * ret = get_attribute_text(&afd->afsi.attributes, " ", &tmp); if (ret < 0) goto err; - tmp[sizeof(afd->attributes_string) - 1] = '\0'; - strcpy(afd->attributes_string, tmp); /* OK */ + assert(tmp); + strncpy(afd->attributes_string, tmp, sizeof(afd->attributes_string)); + afd->attributes_string[sizeof(afd->attributes_string) - 1] = '\0'; free(tmp); aced.aft_row = aft_row;